JuniorWoodchuck24
Registered User.
- Local time
- Today, 14:02
- Joined
- Jan 13, 2010
- Messages
- 59
I'm trying to load data that I have stored in a file and bring it into a form. The data was imported from excel and then I'm going to edit it within a from. I'm trying to use the FindFirst function to track an item down by it's Product Number.
I have a load button that does OnClick event with following code
Dim xtxtProductNumber
Dim db As Database
Dim rs As Recordset
xtxtProductNumber = Me![txtProductNumber]
Set db = CurrentDb()
Set rs = db.OpenRecordset("Products", dbOpenDynaset)
rs.FindFirst "ProductNumber = 'xtxtProductNumber' "
My error at the moment is that it is just returning the first item in the table and it doesn't matter what the product number is.
I have a load button that does OnClick event with following code
Dim xtxtProductNumber
Dim db As Database
Dim rs As Recordset
xtxtProductNumber = Me![txtProductNumber]
Set db = CurrentDb()
Set rs = db.OpenRecordset("Products", dbOpenDynaset)
rs.FindFirst "ProductNumber = 'xtxtProductNumber' "
My error at the moment is that it is just returning the first item in the table and it doesn't matter what the product number is.