missymarie1014
Technical User
I have the following code isolated in the Exit event of a form control, and it is producing the following error message....
The Microsoft Jet database engine cannot find the input table or query 'False'. Make sure it exists and that its name is spelled correctly.
Here is the code.....
I can't seem to make sense of the reference to "False". It produces the same error in the After Update event for the control. Can someone give me some assistance with this and tell me what it means? Thanks very much!
The Microsoft Jet database engine cannot find the input table or query 'False'. Make sure it exists and that its name is spelled correctly.
Here is the code.....
Code:
Dim CurDB As Database
Dim rs As recordset
Dim Resp As Integer
Set CurDB = CurrentDb
Set rs = CurDB.OpenRecordset("SELECT * from ItemTable WHERE" & _
Item = Me.ItemUsed)
If rs.RecordCount = 0 Then
rs.Close
Set rs = Nothing
Else
rs.MoveFirst
Do Until rs.EOF
If rs!QuantityOnHand = 0 And rs!CurrentCost = 0 Then
Resp = MsgBox("This Batch Template Contains Items With Zero Quantity On Hand And Zero Cost!" _
& vbCrLf & vbCrLf & "Receipt Or Production Of These Items Is Required" _
& vbCrLf & vbCrLf & "To Insure That Accurate Costs Are Being Maintained", _
vbOKOnly + vbCritical, "Template Contains Items With Zero Quantity And Zero Cost!")
Exit Sub
Exit Do
Else
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End If
I can't seem to make sense of the reference to "False". It produces the same error in the After Update event for the control. Can someone give me some assistance with this and tell me what it means? Thanks very much!