A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Syntax error in date in query expression issue



 
 
Thread Tools Display Modes
  #1  
Old January 29th, 2010, 04:09 PM posted to microsoft.public.access.forms
floyd33 via AccessMonster.com
external usenet poster
 
Posts: 38
Default Syntax error in date in query expression issue

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=F orms!
[frmMeeting]![subfrmAttendees].Form![SpeakerID]")

why would I be getting this error? Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1

  #2  
Old January 29th, 2010, 04:18 PM posted to microsoft.public.access.forms
ghetto_banjo
external usenet poster
 
Posts: 325
Default Syntax error in date in query expression issue

put brackets around FaciLicense# in the Dlookup


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


Access sees the pound sign and thinks it is a date.
  #3  
Old January 29th, 2010, 04:21 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Syntax error in date in query expression issue

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."

"floyd33 via AccessMonster.com" u17874@uwe wrote in message
news:a2d779f14f6cb@uwe...
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=F orms!
[frmMeeting]![subfrmAttendees].Form![SpeakerID]")

why would I be getting this error? Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1



  #4  
Old January 29th, 2010, 04:47 PM posted to microsoft.public.access.forms
floyd33 via AccessMonster.com
external usenet poster
 
Posts: 38
Default Syntax error in date in query expression issue

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

ghetto_banjo wrote:
put brackets around FaciLicense# in the Dlookup

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

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


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1

  #5  
Old January 29th, 2010, 04:48 PM posted to microsoft.public.access.forms
floyd33 via AccessMonster.com
external usenet poster
 
Posts: 38
Default Syntax error in date in query expression issue

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 Campagna wrote:
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!


--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.