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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find code not working - Form

Status
Not open for further replies.

101287

MIS
Apr 8, 2006
189
US
I have the following code in my access application. The works 95% of the time but in ocassion it does not retrieve a record in the table. Can someone provide some guidance to correct this problem. Or work around. This code is execute when the custmer enter a number on a form and the record is display on the form.The code us use after update to get
a specific record. Or if there any other ways that I can retrieve the record and bound it to the form. ======================================================= Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[ID] = " & str(Nz(Me![cboNumber], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If rs.NoMatch Then
MsgBox "You need to update (instanciate)
record before selecting a new one." & vbNewLine
& "Please close the detail form and re-start your
activity.",vbInformation, "F-35 Self Portal"
End If
end if ========================================================
Guidance and collaboration will be appreciated.

Luis
 
I would try

rs.MoveLast
rs.MoveFirst

This will cause access to cycle the entire rs and sets it at the first record before you look for your match. I have found access a little funky with recordsets and record counts unless you add the code to your function.

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top