FindRecord problem

G

Guest

I'm having difficulty with the FindRecord method. I want to have a user doubleclick a record in a form to open another form and locate the selected record. FindRecord works for the first 50 records, but not for any after that. Also, I've used the exact same code on a separate form to perform the same actions and it works for all records in that instance. Here's the code for the first form:

Private Sub Form_DblClick(Cancel As Integer)
If Not IsNull(Me![Person ID]) Then
DoCmd.OpenForm "Person Details"
DoCmd.GoToControl "Person ID"
DoCmd.FindRecord Forms![Administration Form]![Subform Control].Form![Person ID], A_ENTIRE
End If
End Sub

The app seems to be executing the code before all records are loaded, which would explain why the first 50 records work, but no others. Also, the recordset for the non-working form contains about 800 records, while the other one that works only has 200.

I've also tried moving the code to the OnOpen, OnLoad, and OnActivate events of the form I'm trying to open. None of these work.
 
S

Steve Schapel

Mike,

It would be easier to do like this...

Private Sub Form_DblClick(Cancel As Integer)
DoCmd.OpenForm "Person Details", , , "[Person ID]=" & Me.Person_ID
End Sub
 

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

Similar Threads

FindRecord Error 2
Findrecord giving a msg 1
Problem with FindRecord in Access 2007 1
Form with two nested subforms. 8
Help with FindRecord 1
FindRecord help 1
Cycle to first record? 1
FindRecord 2

Top