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

Opening form to add a new record produces an error

Status
Not open for further replies.

Euphorbiaman

IS-IT--Management
Jun 7, 2006
2
US
Hi,
I have a form based on a query, this form also contains a subform. On the form is a combo box for selecting the name of a patient. Once the patients name is selected both the form and subform is populated with the correct data. When I try to open the form to add a new record (by selecting a name for the combo box) I get an error message 'Run-time error 3021 No current record. Here is the code.

Private Sub combo_0AfterUpdate()
Dim rs As object

Set rs=Me.Recordset.Clone
rs.FindFirst "[FULLNAME] = '" &ME![combo0] & "'"
Me.Bookmark = rs.Bookmark

End Sub

Me.Bookmark = rs.Bookmar is highlighted in yellow when running the debugger.
Thanks for your help.
 
It looks like FindFirst iw returning NoMatch. What's the row source for combo0?
 
How are ya Euphorbiaman . . .
Code:
[blue]   Set rs=Me.Recordset.Clone
  
   rs.FindFirst "[FULLNAME] = '" &ME![combo0] & "'"
   If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top