M
Michael
I need to create an if statement that will first determine whether the
contact type is a client or a vendor. Then, it needs to open a
particular form based on criteria for each of the vendors & clients
sub types. Here is what I came up with so far but obviously it
doesn't work. Can someone show me what I'm missing?
Private Sub ContactID_DblClick(Cancel As Integer)
On Error GoTo Err_ContactID_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
If Me![ContactType] = "Vendor" Then
If Me![VendorType] = "Labor Vendor" Then
stDocName = "FRM_Vendors-Labor-Direct"
ElseIf Me![VendorType] = "Resource Vendor" Then
stDocName = "frm_vendorsResource"
Else: stDocName = "FRM_VendorsAll"
End If
stLinkCriteria = "[vendorID]=" & Me![VendorID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Me![ContactType] = "Client" Then
If Me![ContactSubType] = "Clients-Contract" Then
stDocName = "FRM_Clients_Contract"
ElseIf Me![ContactSubType] = "Clients-Direct" Then
stDocName = "Frm_Clients_Direct"
Else: stDocName = "FRM_Clients_Indirect"
End If
stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ContactID_DblClick:
Exit Sub
Err_ContactID_DblClick:
MsgBox Err.Description
Resume Exit_ContactID_DblClick
End Sub
contact type is a client or a vendor. Then, it needs to open a
particular form based on criteria for each of the vendors & clients
sub types. Here is what I came up with so far but obviously it
doesn't work. Can someone show me what I'm missing?
Private Sub ContactID_DblClick(Cancel As Integer)
On Error GoTo Err_ContactID_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
If Me![ContactType] = "Vendor" Then
If Me![VendorType] = "Labor Vendor" Then
stDocName = "FRM_Vendors-Labor-Direct"
ElseIf Me![VendorType] = "Resource Vendor" Then
stDocName = "frm_vendorsResource"
Else: stDocName = "FRM_VendorsAll"
End If
stLinkCriteria = "[vendorID]=" & Me![VendorID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Me![ContactType] = "Client" Then
If Me![ContactSubType] = "Clients-Contract" Then
stDocName = "FRM_Clients_Contract"
ElseIf Me![ContactSubType] = "Clients-Direct" Then
stDocName = "Frm_Clients_Direct"
Else: stDocName = "FRM_Clients_Indirect"
End If
stLinkCriteria = "[ContactID]=" & Me![ContactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ContactID_DblClick:
Exit Sub
Err_ContactID_DblClick:
MsgBox Err.Description
Resume Exit_ContactID_DblClick
End Sub