G
Guest
I have received help previously for this problem but I am now having other
problems that I can't work out. I want to be able to enter a tag number into
a field on a form that will retrieve the record from the database table whose
key matches the inputted tag number and display that record on the same form.
The Tag number field field in the table is unique no duplicates allowed so
there is only one record.
I am using Access 2000/2002 and have a form that has an unbound field that I
have called FindRecord and have populated the rest of the form with the
fields I require data to be inserted into from the database table.
As instructed I set up an event procedure as an afterupdate call and wrote
the following code in the event procedure:
Private Sub FindRecord_AfterUpdate()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[Tag Number] = " & Str(Me![FindRecord])
If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
End Sub
I get an error type mismatch '13' on the rs.Findfirst "[Tag Number] etc line.
The unbound field on the form is a text box and the table field tag number
is text up to 15 characters. The data I have entered into the unbound field
is B12346. I don't know why this is not bringing the data back into the
fields and why it is not working. I need some more expert help.
Thanks in advance
Mabeline.
problems that I can't work out. I want to be able to enter a tag number into
a field on a form that will retrieve the record from the database table whose
key matches the inputted tag number and display that record on the same form.
The Tag number field field in the table is unique no duplicates allowed so
there is only one record.
I am using Access 2000/2002 and have a form that has an unbound field that I
have called FindRecord and have populated the rest of the form with the
fields I require data to be inserted into from the database table.
As instructed I set up an event procedure as an afterupdate call and wrote
the following code in the event procedure:
Private Sub FindRecord_AfterUpdate()
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[Tag Number] = " & Str(Me![FindRecord])
If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
End Sub
I get an error type mismatch '13' on the rs.Findfirst "[Tag Number] etc line.
The unbound field on the form is a text box and the table field tag number
is text up to 15 characters. The data I have entered into the unbound field
is B12346. I don't know why this is not bringing the data back into the
fields and why it is not working. I need some more expert help.
Thanks in advance
Mabeline.