I have a query (qryRequests) linking two tables (tblPermits and tblRequests) by the field called Permits_No, with all records from tblRequests and only match records from tblPermits.
I have a form (frmPermits) with a command button that opens a second form (frmRequests) in ADD mode. The Permit_No field is in both forms. Permit_No in tblPermits is populated. When I click the button on frmPermits that opens frmRequests, I would like the Permit_No field to be populated with the same entry as in tblPermits (as displays in frmPermits). Everything seems to be working fine except for the auto-populate function.
I tried a DLookup function but I’m sure I have the wrong syntax. On the “On Click” property I coded:
DLookup("[Permit_No]", "tblPermits", "[Permit_No] = [Permit_No]”) = Me.Permit_No
Obviously this was wrong so I tried hard coding in a permit number (08-60).
DLookup("[Permit_No]", "tblPermits", [Permit_No] = ‘08-60”) = Me.Permit_No
This too failed. Any suggestions would be greatly appreciated.
Thanks,
SKK
I have a form (frmPermits) with a command button that opens a second form (frmRequests) in ADD mode. The Permit_No field is in both forms. Permit_No in tblPermits is populated. When I click the button on frmPermits that opens frmRequests, I would like the Permit_No field to be populated with the same entry as in tblPermits (as displays in frmPermits). Everything seems to be working fine except for the auto-populate function.
I tried a DLookup function but I’m sure I have the wrong syntax. On the “On Click” property I coded:
DLookup("[Permit_No]", "tblPermits", "[Permit_No] = [Permit_No]”) = Me.Permit_No
Obviously this was wrong so I tried hard coding in a permit number (08-60).
DLookup("[Permit_No]", "tblPermits", [Permit_No] = ‘08-60”) = Me.Permit_No
This too failed. Any suggestions would be greatly appreciated.
Thanks,
SKK