I have one other step I would like to know how to code in reference to this topic. This worked great for what I needed with one caveat, it allows duplicate records to be created for the same [Offer_ID] in my table.
How can I get it to look for an existing record using [Offer_ID] and open the record should it exist already or create a new record if it does not?
On Click On Form 1
On Error GoTo Err_cmdOpen_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSLR_ChainInvoice_Detail"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.OFFER_ID
Exit_cmdOpen_Click:
Exit Sub
Err_cmdOpen_Click:
MsgBox Err.Description
Resume Exit_cmdOpen_Click
End Sub
Form Load Event on Form 2
Private Sub Form_Load()
Dim strOpenArgs() As String
If Not IsNull(Me.OpenArgs) Then
strOpenArgs = Split(Me.OpenArgs, ";")
Me.OfferID = strOpenArgs(0)
Else
' .. Do something else
End If
End Sub