View Single Post
  #4  
Old July 8th, 2009, 04:42 PM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Set Value Macro throwing automation error

Yes.

Is the ProjectCodeID of interest available through a control on the form?

DLookup("[Start Date]", "tblMeetings2001", "ProjectCodeID = " &
Forms!NameOfForm!NameOfControl)

or, if ProjectCodeID is text,

DLookup("[Start Date]", "tblMeetings2001", "ProjectCodeID = '" &
Forms!NameOfForm!NameOfControl & "'")

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"floyd33 via AccessMonster.com" u17874@uwe wrote in message
news:98c59f1d4953a@uwe...
No there are many rows of data in TblMeetings2001, so I need to match it
with
the row in tblAttendeeInformation. I have ProjectCodeID in
tblAttendeeInformation and and MeetingID in tblMeetings2001. I suppose I
need a where clause in that expression?

Thanks for your help!

Douglas J. Steele wrote:
Your syntax is incorrect for the DLookup function.

DLookup("[Start Date]", "tblMeetings2001")

This assumes that there's only a single row of data in tblMeetings2001. If
that's not the case, you're going to essentially get the value from a
random
row in the table.

I have a form with fields from two tables (tblAttendeeInformation and
tblMeetings2001). I am trying to put a macro on one field that will set

[quoted text clipped - 14 lines]

Thanks!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200907/1