Open form

  • Thread starter Thread starter Andrew Anderson
  • Start date Start date
A

Andrew Anderson

How can I transfer this simple Event Procedure..

Private Sub Command15_Click()
On Error GoTo Err_Command15_Click


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FRM_prod-test_info_DSD"


stLinkCriteria = "[GSKBatchNo]=" & "'" & Me!
[GSKBatchNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_Command15_Click:
Exit Sub

Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click

....Into a Macro so that the Form opens with the same
Parent form information and closes the form that the
button was on?
 
These actions should go into the macro:

Action: OpenForm
Form Name: FRM_prod-test_info_DSD
Criteria: ="[GSKBatchNo]=" & Forms!PutYourFormNameHere!GSKBatchNo

Action: Close
Object: Form
Object Name: PutYourFormNameHere


Replace PutYourFormNameHere with the name of the form on which the button is
located.
 
Back
Top