S
sheena
I have created a form in Access 2002 when the user clicks on either of the
buttons on the form which both open new pagesi would like the page to close.
i looked at the coding attached to the button and this is what it read.
Private Sub Enter_pg1_Click()
On Error GoTo Err_Enter_pg1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Data_Capture_step_2"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Enter_pg1_Click:
Exit Sub
Err_Enter_pg1_Click:
MsgBox Err.Description
Resume Exit_Enter_pg1_Click
End Sub
i think the code to close a form is
DoCmd.OpenQuery "query name", acViewNormal, acReadOnly
DoCmd.Close acForm, "form name"
is this coorect?
And if so where abouts would tihis need to be entered into the above code so
that my form will close after it has carried out the fuctions it needs to.
buttons on the form which both open new pagesi would like the page to close.
i looked at the coding attached to the button and this is what it read.
Private Sub Enter_pg1_Click()
On Error GoTo Err_Enter_pg1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Data_Capture_step_2"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Enter_pg1_Click:
Exit Sub
Err_Enter_pg1_Click:
MsgBox Err.Description
Resume Exit_Enter_pg1_Click
End Sub
i think the code to close a form is
DoCmd.OpenQuery "query name", acViewNormal, acReadOnly
DoCmd.Close acForm, "form name"
is this coorect?
And if so where abouts would tihis need to be entered into the above code so
that my form will close after it has carried out the fuctions it needs to.