Hi
Ive set up a command button (suppliernbutton) to open up a new form. I would like to also set up an event on this suppliernbutton click to close the current form.
I know that the close form code is DoCmd.Close but how would I use this in the click event code below to close the current form?
Im new to VB programming so please help!!
Private Sub suppliernbutton_Click()
On Error GoTo Err_suppliernbutton_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "SupplierForm1"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_suppliernbutton_Click:
Exit Sub
Err_suppliernbutton_Click:
MsgBox Err.Description
Resume Exit_suppliernbutton_Click
End Sub
Ive set up a command button (suppliernbutton) to open up a new form. I would like to also set up an event on this suppliernbutton click to close the current form.
I know that the close form code is DoCmd.Close but how would I use this in the click event code below to close the current form?
Im new to VB programming so please help!!
Private Sub suppliernbutton_Click()
On Error GoTo Err_suppliernbutton_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "SupplierForm1"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_suppliernbutton_Click:
Exit Sub
Err_suppliernbutton_Click:
MsgBox Err.Description
Resume Exit_suppliernbutton_Click
End Sub