Dlookup and varible (1 Viewer)

lcline

Registered User.
Local time
Today, 06:01
Joined
Oct 23, 2001
Messages
53
Thanks in advance for any help rendered!

I have a form that I am using several lookups on to check values used in conditional statements. I have cluttered the form with hidden text boxes to hold the values of one lookup so that I can pass them to the next lookup.

The top lookup works fine but again I am needlessly holding the value in a hidden txt box. I used search and found some examples of how to pass the varible NextPMDate, but I can't seem to get it too work. Would someone please look at it and explain what I am doing wrong?


Me.txtValueHoldrForNextPm = NextPMDate
NextPMType = DLookup("[PMType]", "[dbo_tblWorkOrder]", "[Dept]= [cmbDept] And [LineNum] = [txtLineNum] and [ScheduledDate] = [txtValueHoldrForNextPm]")


NextPMType = DLookup("[PMType]", "[dbo_tblWorkOrder]", "[Dept]= [cmbDept] And [LineNum] = [txtLineNum] and [ScheduledDate] = " & NextPMDate)

Again thanks,
Lee
 

lcline

Registered User.
Local time
Today, 06:01
Joined
Oct 23, 2001
Messages
53
I am sorry! I did not say that the top example works fine, but uses hidden text boxes to hold the value!

The second one was based from an example at MSDN.

Again thanks for any guidence!
Le
 

Users who are viewing this thread

Top Bottom