Open form

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?
 
K

Ken Snell

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Quick Coding Issue 3
Help please 1
Report To Snapshot 4
Open Form based on Mutiple Combo Selection 1
Problem with Parameter Query from a Form 5
Run time error 2494 1
Criteria when opening form 1
refresh form 2

Top