Syntax Error (Missing Operator) ...Aaaargh!!!!

DeutchBose

Board Regular
Joined
Mar 22, 2004
Messages
83
I'm using a DLookup Function as follows:

Dim ATime As String
Dim APath As String

ATime = Me.lbl1Recent.Caption

APath = DLookup("Path", "QryDateOrder1", "[TimeStamp] = " & ATime)

I get the following error:

Run-time error '3075'

Syntax error (missing operator) in query expression '[TimeStamp] = 1/28/2005 10:08:00 AM'


----
I've tried definining ATime as a Date instead of a String, but that doesn't seem to make a difference...what am I doing wrong?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I had this problem while i was in school, but that was to do with access error and it couldn't access the database to grab the files and put them into a program.
Have you checked all the access codes eg write modift and create... etc. to make sure you have complete access to it.
another thing it could be to do with the SQL that its using,
just a thought, might not be right but its worth a try...
 
Upvote 0

Forum statistics

Threads
1,221,848
Messages
6,162,415
Members
451,762
Latest member
Brainsanquine

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top