View Full Version : String Value Is Not A Date


doco
12-31-2007, 03:50 PM
rsConfirmLetters.FindFirst "instrument_# = '" & szDeed & "'"


The value of szDeed is "070458" which is an actual document number. When running the code above I get this absurd error:


Run_time error '3077':

Syntax error in date in expression


Evidently Access believes the value '070458' is a date and it is not. It comes from a table column data type text.
What does it take to convince Access this is text and not date? :mad:

TIA

pbaldy
12-31-2007, 04:16 PM
One guess is the inadvisable "#" symbol in the field name. Try this:

rsConfirmLetters.FindFirst "[instrument_#] = '" & szDeed & "'"

doco
12-31-2007, 04:34 PM
Inadvisable


I like it when I find things like that in BE dbs (SQL SERVER) designed by 'professionals' ;). I am away from the office now so will try it later. You are no doubt quite correct though. Thanks

Happy New Year!!!!:D

Dropped by the office on the way to party - that did the trick!

Pat Hartman
01-01-2008, 11:11 AM
Be sure to point out to the "professionals" that ONLY the letters a-z (upper or lower), the numbers 0-9 and the underscore are acceptable characters in a proper name. No special characters or spaces should ever be used.