Hi,
Please excuse my amateur approach here:
I have a table with records in it called 'sheet1'
I then have a form, with an unbound text box on it, with the below code behind the after update function. (this is just the start of the code).
So, if in my table my 'Barcode No' field is formatted to a number data type, this code works fine; but i need to format my 'Barcode No' field in my table to text data type; but then i get a data mismatch error appear. How can i make this work with text instead of number?
Private Sub ScanBarcode_AfterUpdate()
Me.ItemCode = ""
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Sheet1", dbOpenDynaset)
With rst
.FindFirst "[Barcode No] = " & Me.ScanBarcode
After this code there is a whole load of additional code, to populate other objects on my form from the record that is found from the above.
I have been pulling my hair out with this for days, so any help would be greatly appreciated.
Many thanks
Please excuse my amateur approach here:
I have a table with records in it called 'sheet1'
I then have a form, with an unbound text box on it, with the below code behind the after update function. (this is just the start of the code).
So, if in my table my 'Barcode No' field is formatted to a number data type, this code works fine; but i need to format my 'Barcode No' field in my table to text data type; but then i get a data mismatch error appear. How can i make this work with text instead of number?
Private Sub ScanBarcode_AfterUpdate()
Me.ItemCode = ""
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Sheet1", dbOpenDynaset)
With rst
.FindFirst "[Barcode No] = " & Me.ScanBarcode
After this code there is a whole load of additional code, to populate other objects on my form from the record that is found from the above.
I have been pulling my hair out with this for days, so any help would be greatly appreciated.
Many thanks