Database Details:
I have 2 tables; "tblContrac ts" and "tblVendorI nfo" and a form ("frmVendorInfo ) created off of the table "tblVendorInfo" . I have fields including: "PO Number" (Primary Key), "Vendor", "Street", and "Zip" in the table "tblContrac ts". All the PO Numbers, Vendors, etc. are stored in the table "tblContrac ts".
My Question:
I need to know how to automatically fill-in the "Vendor", "Street", and "Zip" fields once a "PO Number" is selected from a combo box on the form. Does this have to be done by a dlookup? Or can it be easier than that?
What I've been trying:
I have attempted to research this and I came up with some code such as:
I'm getting Run-time error '3075'
Syntax error (missing operator) in
Query expression 'PO Number=WWV11858 '
I am a beginner and any very simplified help would be much appreciated. Let me know if I'm on the right track or I should be doing something totally different. Thanks!!
Jon
I have 2 tables; "tblContrac ts" and "tblVendorI nfo" and a form ("frmVendorInfo ) created off of the table "tblVendorInfo" . I have fields including: "PO Number" (Primary Key), "Vendor", "Street", and "Zip" in the table "tblContrac ts". All the PO Numbers, Vendors, etc. are stored in the table "tblContrac ts".
My Question:
I need to know how to automatically fill-in the "Vendor", "Street", and "Zip" fields once a "PO Number" is selected from a combo box on the form. Does this have to be done by a dlookup? Or can it be easier than that?
What I've been trying:
I have attempted to research this and I came up with some code such as:
Code:
Private Sub PONumber_AfterUpdate()
Vendor = DLookup("Vendor", "tblContracts", "PO Number =" & PONumber)
End Sub
Syntax error (missing operator) in
Query expression 'PO Number=WWV11858 '
I am a beginner and any very simplified help would be much appreciated. Let me know if I'm on the right track or I should be doing something totally different. Thanks!!
Jon
Comment