W
Walter
I have the following code in the on click event of a command button. I have
some issues with quotes and in trying to get those worked out I discovered
that the variable "lngSVC" in the SQL shows no value although it does show a
value in the set value line. The variable "varTruck" shows the same value in
both places. As I presently have it I get an Error "Too few parameters.
expect 1". Why is the variable's value not showing?
Dim C As Control, lngSVC As Long, varTruck As Variant, strSQL As String
lngSVC = Me.Parent!Odometer (number field)
varTruck = Me.Parent!TruckID (text field)
strSQL = _
"UPDATE tblTrucks " & _
"SET tblTrucks.LastRoutineService = lngSVC " & _
"WHERE (((tblTrucks.TruckID) ='" & varTruck & "'" & "));"
For Each C ..........................................etc
some issues with quotes and in trying to get those worked out I discovered
that the variable "lngSVC" in the SQL shows no value although it does show a
value in the set value line. The variable "varTruck" shows the same value in
both places. As I presently have it I get an Error "Too few parameters.
expect 1". Why is the variable's value not showing?
Dim C As Control, lngSVC As Long, varTruck As Variant, strSQL As String
lngSVC = Me.Parent!Odometer (number field)
varTruck = Me.Parent!TruckID (text field)
strSQL = _
"UPDATE tblTrucks " & _
"SET tblTrucks.LastRoutineService = lngSVC " & _
"WHERE (((tblTrucks.TruckID) ='" & varTruck & "'" & "));"
For Each C ..........................................etc