
Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thank you for the quick response. I've changed my code to reflect your
suggestions, but I may have missed something because it still opens the form
to the first record and not the desired record or the one the old code would
filter directly to. Incidentally, I was referencing the wrong control or
field and have corrected it (FNNum). The correct field is an indexed and
unique text field and i have adjusted the code to reflect that as well.
Here's what i have:
On the frm_footnote Load event
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Me.FNNum.SetFocus
DoCmd.FindRecord Me.OpenArgs, acEntire, , acSearchAll, , acCurrent
End If
End Sub
On Error GoTo Err_cmdHistory_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_Footnote"
stLinkCriteria = "[FNNum] = '" & Me.FNNum & "'"
DoCmd.OpenForm stDocName, , , , , , stLinkCriteria
Exit_cmdHistory_Click:
Exit Sub
Err_cmdHistory_Click:
MsgBox Err.Description
Resume Exit_cmdHistory_Click
End Sub
Do i need to change any other settings to get this to work? should i have
something in the FindFirst option of the DoCmd.FindRecord? Thanks again.
> > I have a continuous form that i use to filter particular records on a unique
> > ID (FNID). On this continuous form i have a button that opens another form
[quoted text clipped - 31 lines]
> DoCmd.FindRecord Me.OpenArgs, acEntire, , acSearchAll, , acCurrent
> End If
fredg - 29 Feb 2008 17:10 GMT
> Thank you for the quick response. I've changed my code to reflect your
> suggestions, but I may have missed something because it still opens the form
[quoted text clipped - 65 lines]
>> DoCmd.FindRecord Me.OpenArgs, acEntire, , acSearchAll, , acCurrent
>> End If
You seemed to have somehow combined 2 different procedures.
Code the first Form's event that you use to open the second form:
Private Sub cmdHistory_Click()
On Error GoTo Err_cmdHistory_Click
Dim stDocName As String
stDocName = "frm_Footnote"
DoCmd.OpenForm stDocName, , , , , , Me![FNNum]
Exit_cmdHistory_Click:
Exit Sub
Err_cmdHistory_Click:
MsgBox Err.Description
Resume Exit_cmdHistory_Click
End Sub
Do not add to or change the above code except to change the name of
the event if I have that wrong.
Code the second Form's Load event:
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Me.FNNum.SetFocus
DoCmd.FindRecord Me.OpenArgs, acEntire, , acSearchAll, , acCurrent
End If
End Sub
Then your code in the second form's Load event should work just fine.
It works for me.
The above assumes that [FNNum] contains a unique value that will
identify the correct record.

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
frenchie70 - 29 Feb 2008 17:45 GMT
That did it. Thank you for your patience and help.
> > Thank you for the quick response. I've changed my code to reflect your
> > suggestions, but I may have missed something because it still opens the form
[quoted text clipped - 100 lines]
> The above assumes that [FNNum] contains a unique value that will
> identify the correct record.