Linked Data

lunchboxfl

Registered User.
Local time
Today, 04:53
Joined
Feb 4, 2008
Messages
12
I have some code. It is working great and grabbing the Device info from an inventory database and putting it into the current form device type. The issue is that it displays the sames device in every record from that point on. Any help would be greatly appreciated.

Private Sub Monitor_SN_Txt_AfterUpdate() Monitor_Type_Txt = Dlookup("device_type", "inventory", "serial_number = '" & Monitor_SN_Txt & "'")End Sub
 
My guess is that you are using a continuous form. Your code sets the control Monitor_type_txt equal to the dlookup value. Since in actuality there is only one control with that name, then it will display the same monitor type based on which record is selected. I'm guessing that this continous form is also unbound?
 
The Device_Type field is unbound. How do we resolve this. I would like via dslookup to pull the info from the Inventory database and keep all records correct. Sorry new to this.
 
From what I can tell, you dont need to use a dlookup. Simply add the Inventory table to the query and join the two tables together via the serial number.
 
I have already done that. They are joined via serial and using the dlookup, but just keeps the last updated record device type info.
 
Is there any way for you to post a copy of your database? You can remove any sensitive data. Also, if you are using A2007, save it as a MDB file. Compact and zip to shrink the size.
 
Thanks for the help. I figured it out by pasting the following in the source code of the field.

=DLookUp("device_type","inventory","serial_number = '" & [Monitor_SN_Txt] & "'")
 

Users who are viewing this thread

Back
Top Bottom