Field Problem

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have a form that I am using for receiving in Purchase
Orders. When the user types in the PO# I would like the
Vendor Name to be pulled from a different table and appear
on a field in my form. How can I do this?
 
Chris,

Put this code in the AfterUpdate event of the PO# textbox:

Me!NameOfVendorTextBox =
DLookup("VendorName","QryVendorNameForPOReceiving","[POID] = " & Me!POID)

Where QryVendorNameForPOReceiving is a query joining TblVendor and TblPO.
 
I have a form that I am using for receiving in Purchase
Orders. When the user types in the PO# I would like the
Vendor Name to be pulled from a different table and appear
on a field in my form. How can I do this?

One way to do this would be to set the Control Source of a textbox to
an expression like

=DLookUp("[Vendor Name]", "[qryPOVendor]", "[PO#] = " & Me![txtPO#])

This assumes that you have a Query named qryPOVendor linking the two
tables, that your form textbox containing the PO number is named
txtPO#, and that PO# is a Number type; if it's Text, use

"[PO#] = '" & Me![txtPO#] & "'"
 
Back
Top