H
HeliCaptKirk
I would like to know how to correctly concatenate the dlookup string. If I
do each criteria individually, it runs correctly, but obviously get the first
hit in the table. Every time I concatenate the three criteria, I get a "Type
Mismatch" error.
You all have been so helpful in the past. can you help me here:
Here's the code:
If Not IsNull(Me.ReviewGroupNum) Then
Dim AssignedQTR As String
Dim CurrentGroupNum As String
Dim CategoryField As String
Dim DeactivatedState As Boolean
DeactivatedState = True
CategoryField = "ReviewQuarter"
CurrentGroupNum = Me.Form.ReviewGroupNum.Value
AssignedQTR = DLookup("[ValuePrimary]", "tblCategoryList",
"[CategoryName] = '" & CategoryField & "'" And "[ValueSecondary] = '" &
CurrentGroupNum & "'" And "[Deactivated] <> '" & DeactivatedState & "'")
Me.ubtxtReviewQTR = AssignedQTR
Else
Me.ubtxtReviewQTR = ""
End If
FYI: If I do a code break point, I can see all the criteria values populate
with the correct criteria parameters. The system always fails on the Dlookup
line...
thanks.
Kirk
do each criteria individually, it runs correctly, but obviously get the first
hit in the table. Every time I concatenate the three criteria, I get a "Type
Mismatch" error.
You all have been so helpful in the past. can you help me here:
Here's the code:
If Not IsNull(Me.ReviewGroupNum) Then
Dim AssignedQTR As String
Dim CurrentGroupNum As String
Dim CategoryField As String
Dim DeactivatedState As Boolean
DeactivatedState = True
CategoryField = "ReviewQuarter"
CurrentGroupNum = Me.Form.ReviewGroupNum.Value
AssignedQTR = DLookup("[ValuePrimary]", "tblCategoryList",
"[CategoryName] = '" & CategoryField & "'" And "[ValueSecondary] = '" &
CurrentGroupNum & "'" And "[Deactivated] <> '" & DeactivatedState & "'")
Me.ubtxtReviewQTR = AssignedQTR
Else
Me.ubtxtReviewQTR = ""
End If
FYI: If I do a code break point, I can see all the criteria values populate
with the correct criteria parameters. The system always fails on the Dlookup
line...
thanks.
Kirk