Like this:
In the Primary Form:
Code:
Private Sub Go2SecondaryForm_Click()
If Nz(Me.RecordID,"") <> "" Then
DoCmd.OpenForm "Secondary Form", , , , , , Me.RecordID
Else
MsgBox "A RecordID Must Be Entered First!"
End If
End Sub
In the Secondary Form:
Code:
Private Sub Form_Load()
Dim rst As Recordset
If Nz(Me.OpenArgs,"") <> "" Then
Set rst = Me.RecordsetClone
rst.FindFirst "[RecordID] = " & Me.OpenArgs
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
Else
Msgbox "Matching Record Not Found!"
End If
rst.Close
Set rst = Nothing
End If
End Sub
The above code assumes that RecordID is Numeric. If it is actually defined Text, replace the line
rst.FindFirst "[RecordID] = " & Me.OpenArgs
with
rst.FindFirst "[RecordID] = '" & Me.OpenArgs & "'"
You'll also need to replace Go2SecondaryForm with the actual name of your SecondaryForm.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007