JustJerry
10-05-2005, 03:55 PM
I have the following code on another database that I am trying to incorporate into a new database. This code works fine as long as 'ID' is a "Number" data type.
Private Sub Combo214_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo214], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
However, in the new database, 'ID' is a text value and I tried changing the code, with no luck, to work as follows:
Private Sub Combo12_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " Me![Combo12]
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
When running the above code, I get a 'type mismatch' error.
Thanks in advance for any help
Jerry
Private Sub Combo214_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo214], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
However, in the new database, 'ID' is a text value and I tried changing the code, with no luck, to work as follows:
Private Sub Combo12_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " Me![Combo12]
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
When running the above code, I get a 'type mismatch' error.
Thanks in advance for any help
Jerry