Goto Record

P

Pierre

I'm going to use a code I found in a post dated 1/16/2008:Goto Record
Problem. Doing so I ran into a problem.
Once I entered the code in Text256_AfterUpdate I recived the following Run
Time error '13' Type mismatch.

'Here is the modified code I entered.
Private Sub Text256_AfterUpdate()
Dim rs As Object
Set rs - Me.Recordset.Clone
'NOTE: BELOW LINE is hightlighted in yellow when I debug
rs.FindFirst "[Sur Name] = " & Str(Nz(Me![Text256],0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.[Given Name].SetFocus
Me.Text256 = ""
End Sub

' Can anyone please provide some input as to what I could have done wronge.
 
J

Jeanette Cunningham

Pierre,
this is how I usually do this type of thing
Check that the LastName field in your table is called Sur Name with a space
in it and not SurName

Private Sub Text256_AfterUpdate()
Dim rs As DAO.recordset
Set rs = Me.Recordset.Clone
If Not IsNull(Me.Text256) Then
rs.FindFirst "[Sur Name] = """ & Me.Text256 & """"
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
Me.[Given Name].SetFocus
Else
Msgbox "Not found"
End If
End If
set rs = nothing
End Sub

Jeanette Cunningham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top