Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rs.bookmark problem

Status
Not open for further replies.

mikeba1

Programmer
Jan 2, 2005
235
GB
I have a form with a combo box to find a particular record

Private Sub Combo55_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[membership no] = '" & Str(Me![Combo55]) & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Combo55 = ""

End Sub

The form is based on a query as is the combo
Membership no is the primary key on the table

The problem is that it only displays the first record irrespective of the selection.
I have used this on another form which works fine.
Am I missing something obvious
Thanks

 
Have you tried:

rs.FindFirst "[membership no] = " & Me![Combo55]

I suggest this because I suspect membership no is numeric.

 
How are ya mikeba1 . . .

Perhaps this:
Code:
[blue]   Dim rs As DAO.Recordset
   
   Set rs = Me.Recordset.Clone
   rs.FindFirst "[membership no] = '" & Me!Combo55 & "'"
   
   If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
   Me.Combo55 = ""
   
   Set rs = Nothing[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top