I have copied a very useful code for me, but i cannot use it, since i cannot handle
the CustomerID number in the table Customers. The table in the original example has a Text value for its CustomerID value.
The code finds a customer by writing the leters on a control called FindIt, and then in the AfterUpdate event i find all the information
about that customer.The code works fine in case that the CustomerId is a text field.
But the CustomerId in my table is an Autonumber field. And i receive the error type mismatch.When i convert my
CustomerId to be Text, then it works again fince, so obviously here is the mistake. But i need my CustomerId to be an Autonumber. But
how can i imporve the code so that i works with a table where the Customerid is not a text but an Autonumber?
Here is the whole original code i have copied:
Private Sub Findit_AfterUpdate()
‘Use the bookmark to move to a the selected customer
‘From “Microsoft Access 2000 Development Unleashed” (SAMS)
‘By: Forte, Howe, Ralston
Dim rsclone As DAO.Recordset
Dim recordID As Variant
Dim IDValue As String
Set rsclone = Me.RecordsetClone
IDValue = Me![Findit]
recordID = “CustomerID = ‘” & IDValue & “‘”
rsclone.FindFirst recordID
bm = rsclone.Bookmark
Me.Bookmark = bm
End Sub
I have tried to replace DimIDValue as String with Dim IDValue As Integer
but again no success.
Will be grateful for any help