Hi
I'd like to know how can I create a button to close one form and open another one with 1 click.
I'd like to close "Add or Delete Customer" form and open "Add an Order and Details" form
I have 2 buttons at the moment:
To open "Add an Order and Details" I have code:
Private Sub Command118_Click()
On Error GoTo Err_Command118_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Add an Order and Details"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command118_Click:
Exit Sub
Err_Command118_Click:
MsgBox Err.Description
Resume Exit_Command118_Click
End Sub
And to close "Add or Delete Customer" form I use the normal cmd.close command:
Private Sub CloseForm_Click()
On Error GoTo Err_CloseForm_Click
DoCmd.Close
Exit_CloseForm_Click:
Exit Sub
Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
End Sub
Can anyone help me to put these two under one button please?
Regards,
Kirret
I'd like to know how can I create a button to close one form and open another one with 1 click.
I'd like to close "Add or Delete Customer" form and open "Add an Order and Details" form
I have 2 buttons at the moment:
To open "Add an Order and Details" I have code:
Private Sub Command118_Click()
On Error GoTo Err_Command118_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Add an Order and Details"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command118_Click:
Exit Sub
Err_Command118_Click:
MsgBox Err.Description
Resume Exit_Command118_Click
End Sub
And to close "Add or Delete Customer" form I use the normal cmd.close command:
Private Sub CloseForm_Click()
On Error GoTo Err_CloseForm_Click
DoCmd.Close
Exit_CloseForm_Click:
Exit Sub
Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
End Sub
Can anyone help me to put these two under one button please?
Regards,
Kirret