I have a shipping form that pulls information from a shipping table and a machine table - It shows each machine's shipping information. The form is set to continuous and the shipping table is it's data source. However on open I have a dLookup function that fills in the machines ID number and Port of Entry from the machine table. I am using a a Dlookup function to fill in this information because I cannot use a query to populate the form - I need to be able to edit the shipping information on this form.
My problem is that the Dlookup function populates every row with the first machine's information. Is there a different way I should Do this?? This is my code on the form open -
Dim StrFilter, str2 As String
StrFilter = "machineID = " & Me!machineID
Me!txtPONumber = DLookup("PONumber", "dbo_tblMachine", StrFilter)
Me!txtorigShip = DLookup("OrigRequestedShip", "dbo_tblPurchaseOrder", StrFilter)
Me!txtPortofEntry = DLookup("tblPortOfEntrynew", "dbo_tblPurchaseOrder", StrFilter)
str2 = "ID = " & Me!txtPortofEntry
Me!txtPortofEntryvis = DLookup("PortofEntry", "dbo_tblPortofEntry", str2)
My problem is that the Dlookup function populates every row with the first machine's information. Is there a different way I should Do this?? This is my code on the form open -
Dim StrFilter, str2 As String
StrFilter = "machineID = " & Me!machineID
Me!txtPONumber = DLookup("PONumber", "dbo_tblMachine", StrFilter)
Me!txtorigShip = DLookup("OrigRequestedShip", "dbo_tblPurchaseOrder", StrFilter)
Me!txtPortofEntry = DLookup("tblPortOfEntrynew", "dbo_tblPurchaseOrder", StrFilter)
str2 = "ID = " & Me!txtPortofEntry
Me!txtPortofEntryvis = DLookup("PortofEntry", "dbo_tblPortofEntry", str2)