G
Guest
I'm trying to concatenate two strings but it just doesn't seem to be working
for me.
The two I want to concatenate are as follows:
strKm = .txtVehKilometres > DMax("[kilometres]", "[tbl Vehicle Inspection]", _
"[VEHInspType] = 2 OR 3 AND [VEHVehicleNo] = " & .txtVEHvehicleNo) +
5000
strDate = .txtReportDate > DMax("[dateOfInspection]", "[tbl Vehicle
Inspection]", _
"[VEHInspType] = 1 OR 3 AND [VEHVehicleNo] = " & .txtVEHvehicleNo)
And _
.txtReportDate >= DateAdd("m", 6, Date)
The reason I want to do this is because I want to have 3 types of criteria
that will trigger a msgbox
I would like to have
strKm
strDate
strAsix (which is written out as strAsix = strKm + " and " + strDate) - this
is where the type mismatch error that I keep receiving is.
Is there some kind of trick I'm unaware of? because this has always worked
for me in the past. I've also tried it with the ampersand and I get the same
error.
It works for me if I don't concatenate it, but then it's basically
ridiculous because I have virtually the same code written out twice.
Any help will be appreciated
for me.
The two I want to concatenate are as follows:
strKm = .txtVehKilometres > DMax("[kilometres]", "[tbl Vehicle Inspection]", _
"[VEHInspType] = 2 OR 3 AND [VEHVehicleNo] = " & .txtVEHvehicleNo) +
5000
strDate = .txtReportDate > DMax("[dateOfInspection]", "[tbl Vehicle
Inspection]", _
"[VEHInspType] = 1 OR 3 AND [VEHVehicleNo] = " & .txtVEHvehicleNo)
And _
.txtReportDate >= DateAdd("m", 6, Date)
The reason I want to do this is because I want to have 3 types of criteria
that will trigger a msgbox
I would like to have
strKm
strDate
strAsix (which is written out as strAsix = strKm + " and " + strDate) - this
is where the type mismatch error that I keep receiving is.
Is there some kind of trick I'm unaware of? because this has always worked
for me in the past. I've also tried it with the ampersand and I get the same
error.
It works for me if I don't concatenate it, but then it's basically
ridiculous because I have virtually the same code written out twice.
Any help will be appreciated