G
Guest
The code below produces an error message #3464,"Data Type Mismatch in
Criteria Expression" and I would appreciate knowing how to correct the
criteria expression. The code stops running on the next to last line, and the
Criteria shown when the pointer is passed over MyCriteria is: "[CabinNum] =
208", for examlple.
Private Sub CalcTotals()
'Lookup the rates
Dim MyDayExp As String
Dim MyWeekExp As String
Dim MyDomain As String
Dim MyCriteria As String
Dim MyCabNum As String
Dim MyDayRate As Currency
Dim MyWeekRate As Currency
MyCabNum = ctlCabinNum
MyCriteria = "[CabinNum] = " & MyCabNum
If Forms!FrmReservations.Member = "Member" Then
MyDomain = "tblMemberRates"
Else
MyDomain = "tblGuestRates"
End If
If Month([ArrDate]) > 4 And Month(ArrDate) < 11 Then
MyDayExp = "SumrDay"
MyWeekExp = "SumrWk"
Else
MyDayExp = "WintDay"
MyWeekExp = "WintWk"
End If
MyDayRate = DLookup(MyDayExp, MyDomain, MyCriteria)
MyWeekRate = DLookup(MyWeekExp, MyDomain, MyCriteria)
End Sub
Thank you for your consideration.
Criteria Expression" and I would appreciate knowing how to correct the
criteria expression. The code stops running on the next to last line, and the
Criteria shown when the pointer is passed over MyCriteria is: "[CabinNum] =
208", for examlple.
Private Sub CalcTotals()
'Lookup the rates
Dim MyDayExp As String
Dim MyWeekExp As String
Dim MyDomain As String
Dim MyCriteria As String
Dim MyCabNum As String
Dim MyDayRate As Currency
Dim MyWeekRate As Currency
MyCabNum = ctlCabinNum
MyCriteria = "[CabinNum] = " & MyCabNum
If Forms!FrmReservations.Member = "Member" Then
MyDomain = "tblMemberRates"
Else
MyDomain = "tblGuestRates"
End If
If Month([ArrDate]) > 4 And Month(ArrDate) < 11 Then
MyDayExp = "SumrDay"
MyWeekExp = "SumrWk"
Else
MyDayExp = "WintDay"
MyWeekExp = "WintWk"
End If
MyDayRate = DLookup(MyDayExp, MyDomain, MyCriteria)
MyWeekRate = DLookup(MyWeekExp, MyDomain, MyCriteria)
End Sub
Thank you for your consideration.