I know this is probably very simple, but I am stumped.
What I am trying to do is create a form for looking up part numbers.
In the database is a column of "our part numbers" alongside a column of "vendor part numbers".
I want to create a form that has two text boxes, one for "our part numbers" the other for "vendor part numbers".
When I type in the vendor number in the "vendornum" text box, I want the "partnum" text box to update to the correct record that matches.
The closest I have come to doing this is creating a table with both of these columns, then creating a form and adding this code to a command button click.
Code:
Private Sub Refreshbutton_Click()
vendornumbox = DLookup("vendornum", "main", "partnumbox" & partnum)
End Sub
Basically what I was thinking this code would do is, when you click the Refresh command button it will fill the vendor number box with the vendor number matching the part number as specified in the part number box.
However, all it does is no matter what I put in the part number box always update it to the first record in the vendornum column.
Any help would be much appreciated.
TIA