S
ServiceEnvoy
I have created 2 buttons to open 2 different forms but I would like to
create one button to open a certain form based on certain criteria.
Here is my current code for one of the buttons:
Private Sub ContactsForm_Click()
On Error GoTo Err_ContactsForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FRM_Contacts-General"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ContactsForm_Click:
Exit Sub
Err_ContactsForm_Click:
MsgBox Err.Description
Resume Exit_ContactsForm_Click
End Sub
I would like the button to open the Form "FRM_Contacts-General" if the
field "SubType" = advertising, contact, depot, wholesaler, or
manufacturer.
I would like the button to open the form "FRM_Vendors-All" if the
field "SubType" = vendor or employee
How do I do this?
create one button to open a certain form based on certain criteria.
Here is my current code for one of the buttons:
Private Sub ContactsForm_Click()
On Error GoTo Err_ContactsForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FRM_Contacts-General"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ContactsForm_Click:
Exit Sub
Err_ContactsForm_Click:
MsgBox Err.Description
Resume Exit_ContactsForm_Click
End Sub
I would like the button to open the Form "FRM_Contacts-General" if the
field "SubType" = advertising, contact, depot, wholesaler, or
manufacturer.
I would like the button to open the form "FRM_Vendors-All" if the
field "SubType" = vendor or employee
How do I do this?