Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup & Continuous Forms

Status
Not open for further replies.

Sarah28

IS-IT--Management
Aug 6, 2000
16
US
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)
 
Never mind - I linked my SQl tables and created a view - Then based the form on this view - Now it works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top