Dlookup in Form's Control Source !!!

Kasher

Registered User.
Local time
Today, 14:52
Joined
Dec 28, 2012
Messages
16
I have got a table called tblMain with four fields, main_ID, Pin_No, DateTaken and type. And a form called CalenderForm for the month March. I want my form to populate the results after matching the pin_No and DateTaken from the tblMain with the form's textbox date values and vice versa and write the "type" of corresponding DateTaken field into the text box underneath the date textbox on the form. I tried the Dlookup into the control source of (example first textbox underneath the first date textbox) but it is not working. I have attaced the sample database as well... thanks
 

Attachments

Try this for the first textbox:
=DLookUp("[DateTaken]";"tblMain";"[DateTaken] = #" & Format([Forms]![CalenderForm]![txt1];"mm/dd/yyyy") & "# AND [Pin_No] ='" & [Forms]![CalenderForm]![txtpin].[Value] & "'")
 
Ive tried it but it is not displaying anything as it should display DateTaken's correspondant type which is "H" after matching the date and pin no from tblMain.
 
thank you very much JHB , it is sorted, i ve just replaced ";" with "," and it works perfectly:)
 

Users who are viewing this thread

Back
Top Bottom