Syntax error in date in query expression issue

  • Thread starter floyd33 via AccessMonster.com
  • Start date
F

floyd33 via AccessMonster.com

I have a macro on change of a field that sets the value of various other
fields in a form, based on ID's matching. I just needed to add another field
to set the value of and on update am gettings this error: "sntax error in
date in query expression." The field who's value I'm trying to set is not a
date, it's text.

Here's the macro:

Item: [Forms]![frmMeeting]![subfrmAttendees].[Form]![FacilLicense#]
Expression: DLookUp("FacilLicense#","qrySpeakers","SpeakerID=Forms!
[frmMeeting]![subfrmAttendees].Form![SpeakerID]")

why would I be getting this error? Thanks!
 
G

ghetto_banjo

put brackets around FaciLicense# in the Dlookup


DLookup("[FaciLicense#]"....


Access sees the pound sign and thinks it is a date.
 
A

Al Campagna

floyd33,
Right off the top, get rid of the "#" in any field/object names
you may have.
"#" is used by Access in date designations.
Let's try that first... that might just be the problem.

Also, is...
"syntax error in date in query expression."
all you get in the message? It doesn't show part of the string that's
failing?
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
F

floyd33 via AccessMonster.com

You rock. That was it, right off the bat. I appreciate it.

ghetto_banjo said:
put brackets around FaciLicense# in the Dlookup

DLookup("[FaciLicense#]"....

Access sees the pound sign and thinks it is a date.
 
F

floyd33 via AccessMonster.com

As posted above, it was the # sign that was giving the issue. I will keep
that in mind not to use # in field names anymore. Thanks so much!

Al said:
floyd33,
Right off the top, get rid of the "#" in any field/object names
you may have.
"#" is used by Access in date designations.
Let's try that first... that might just be the problem.

Also, is...
"syntax error in date in query expression."
all you get in the message? It doesn't show part of the string that's
failing?
I have a macro on change of a field that sets the value of various other
fields in a form, based on ID's matching. I just needed to add another
[quoted text clipped - 11 lines]
why would I be getting this error? Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top