W
Walter
I keep getting a type mismatch error with the following code.
Dim lngLoad As Long, lngUnload As Long, lngBobtail As Long
'find mileage where last loaded
lngLoad = _
"SELECT Top 1 qryCalculateStatusMiles.Odometer " & _
"FROM qryCalculateStatusMiles " & _
"WHERE (((qryCalculateStatusMiles.StopPurpose) = '" & "Load" & "'" &
")) " & _
" OR (((qryCalculateStatusMiles.StopPurpose)= '" &
"Unload/Reload" & "'" & ")) " & _
"ORDER BY qryCalculateStatusMiles.Odometer DESC;"
Odometer type is long integer in the table.
StopPurpose is text.
Dim lngLoad As Long, lngUnload As Long, lngBobtail As Long
'find mileage where last loaded
lngLoad = _
"SELECT Top 1 qryCalculateStatusMiles.Odometer " & _
"FROM qryCalculateStatusMiles " & _
"WHERE (((qryCalculateStatusMiles.StopPurpose) = '" & "Load" & "'" &
")) " & _
" OR (((qryCalculateStatusMiles.StopPurpose)= '" &
"Unload/Reload" & "'" & ")) " & _
"ORDER BY qryCalculateStatusMiles.Odometer DESC;"
Odometer type is long integer in the table.
StopPurpose is text.