B
Bonnie
I am getting a datatype mismatch error on the statement
below. The datatypes are text for both [StudentNo] and
[YearEnd] but the [SuspensionDate] is a date field. I
have tried to change the quotes and variable types but end
up with syntax errors. Can datatypes be mixed in dlookups
varSuspensionDate = DLookup
("[SuspensionDate]", "tblSuspension", "[StudentNo] = " &
strStudentNo & _
" And " & "[YearEnd] = " & strYear & " And "
& "[SuspensionDate] = " & strTxtSuspensionDate)
below. The datatypes are text for both [StudentNo] and
[YearEnd] but the [SuspensionDate] is a date field. I
have tried to change the quotes and variable types but end
up with syntax errors. Can datatypes be mixed in dlookups
varSuspensionDate = DLookup
("[SuspensionDate]", "tblSuspension", "[StudentNo] = " &
strStudentNo & _
" And " & "[YearEnd] = " & strYear & " And "
& "[SuspensionDate] = " & strTxtSuspensionDate)