From: floyd33 via AccessMonster.com on 29 Jan 2010 11:09 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! -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201001/1
From: ghetto_banjo on 29 Jan 2010 11:18 put brackets around FaciLicense# in the Dlookup DLookup("[FaciLicense#]".... Access sees the pound sign and thinks it is a date.
From: Al Campagna on 29 Jan 2010 11:21 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(a)uwe> wrote in message news:a2d779f14f6cb(a)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=Forms! > [frmMeeting]![subfrmAttendees].Form![SpeakerID]") > > why would I be getting this error? Thanks! > > -- > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201001/1 >
From: floyd33 via AccessMonster.com on 29 Jan 2010 11:47 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/Forums.aspx/access-forms/201001/1
From: floyd33 via AccessMonster.com on 29 Jan 2010 11:48 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
|
Pages: 1 Prev: Calnedar Control Next: Want Users Cursor To Always Go To Beginning Of Field |