C
Chip
I'm trying to open a form based on two criteria. I get the missing operator
error.
Thr code I am using is:
Dim PolicyType As String, PolicyYear As Integer
Dim stDocName As String
Dim stLinkCriteria As String
PolicyType = InputBox("What type: Dental, Medical, Life, LTD or STD?")
PolicyYear = InputBox("What 4 digit Year?")
stLinkCriteria = "[CustomerNumber]=" & Me![CustomerNumber] _
& " And [EffectiveDate] Like */*/" & PolicyYear
Select Case PolicyType
Case Is = "Dental"
stDocName = "sfmCustomerDentalPolicies"
Case Is = "Life"
stDocName = "sfmCustomerLifePolicies"
Case Is = "LTD"
stDocName = "sfmCustomerLTDPolicies"
Case Is = "Medical"
stDocName = "sfmCustomerMedPolicies"
Case Is = "STD"
stDocName = "sfmCustomerSTDPolicies"
End Select
DoCmd.OpenForm stDocName, , , stLinkCriteria
Customer Number is an autonumber.
It works fine with just customer number.
error.
Thr code I am using is:
Dim PolicyType As String, PolicyYear As Integer
Dim stDocName As String
Dim stLinkCriteria As String
PolicyType = InputBox("What type: Dental, Medical, Life, LTD or STD?")
PolicyYear = InputBox("What 4 digit Year?")
stLinkCriteria = "[CustomerNumber]=" & Me![CustomerNumber] _
& " And [EffectiveDate] Like */*/" & PolicyYear
Select Case PolicyType
Case Is = "Dental"
stDocName = "sfmCustomerDentalPolicies"
Case Is = "Life"
stDocName = "sfmCustomerLifePolicies"
Case Is = "LTD"
stDocName = "sfmCustomerLTDPolicies"
Case Is = "Medical"
stDocName = "sfmCustomerMedPolicies"
Case Is = "STD"
stDocName = "sfmCustomerSTDPolicies"
End Select
DoCmd.OpenForm stDocName, , , stLinkCriteria
Customer Number is an autonumber.
It works fine with just customer number.