I have a form "frm_SHIPPING_MAIN" you you pull up the form it will prompt you for an order number. The order number is the unique ID from the Orders table.
While in the "frm_SHIPPING_MAIN" there are a couple more buttons to actually print out a couple forms. The first is "frm_COC_DOT" What do I need to place into this VBA script to make the "frm_COC_DOT" open to the exact record I am looking at in my current form?
example: shipping dept opens main form and pulls up order 16. When the click the "COC DOT" button, the form comes up automatically to order 16.
Private Sub cmd_COC_DOT_Click()
On Error GoTo Err_cmd_COC_DOT_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_COC_DOT"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmd_COC_DOT_Click:
Exit Sub
Err_cmd_COC_DOT_Click:
MsgBox Err.Description
Resume Exit_cmd_COC_DOT_Click
End Sub
Thank you all.
While in the "frm_SHIPPING_MAIN" there are a couple more buttons to actually print out a couple forms. The first is "frm_COC_DOT" What do I need to place into this VBA script to make the "frm_COC_DOT" open to the exact record I am looking at in my current form?
example: shipping dept opens main form and pulls up order 16. When the click the "COC DOT" button, the form comes up automatically to order 16.
Private Sub cmd_COC_DOT_Click()
On Error GoTo Err_cmd_COC_DOT_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_COC_DOT"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmd_COC_DOT_Click:
Exit Sub
Err_cmd_COC_DOT_Click:
MsgBox Err.Description
Resume Exit_cmd_COC_DOT_Click
End Sub
Thank you all.