I have update queries in a select case statement. In case 1 the two queries work fine but in case 5 the code breaks at the first query giving the Error 3078 - The Microsoft Jet database engine cannot find the input table or query ".
I can see no difference between the queries other than word differences. Can someone see something I'm missing?
I can see no difference between the queries other than word differences. Can someone see something I'm missing?
Code:
Case 1
query 1
Dim strSQL As String 'set discard to true and InService to False for OldTire in the tires table
strSQL = _
"UPDATE tblTires " & _
"SET tblTires.Discarded = True, tblTires.InService = False, tblTires.StockStatus = ""UnServicable"" " & _
"WHERE (((tblTires.TireID) =" & intOldTire & "));"
CurrentDb.Execute strSQL, dbFailOnError
query 2
Dim strInService As String 'set New Tire InService to True
strInService = _
"UPDATE tblTires " & _
"SET tblTires.InService = True, tblTires.Discarded = False, tblTires.StockStatus = ""In Service"" " & _
"WHERE (((tblTires.TireID) =" & intNewTire & "));"
CurrentDb.Execute strInService, dbFailOnError
case 5
query 1
Dim CapStock As String 'set InService to False
CapStock = _
"UPDATE tblTires " & _
"SET tblTires.Discarded = False, tblTires.InService = False, tblTires.StockStatus = ""Retread Stock"" " & _
"WHERE (((tblTires.TireID) =" & intOldTire & "));"
CurrentDb.Execute RemoveToStock, dbFailOnError
query 2
Dim strInService5 As String 'set New Tire InService to True
strInService5 = _
"UPDATE tblTires " & _
"SET tblTires.InService = True, tblTires.Discarded = False, tblTires.StockStatus = ""In Service"" " & _
"WHERE (((tblTires.TireID) =" & intNewTire & "));"
CurrentDb.Execute strInService2, dbFailOnError
Comment