By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,949 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,949 IT Pros & Developers. It's quick & easy.

update query error 3078

P: 68
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?
Expand|Select|Wrap|Line Numbers
  1. Case 1
  2. query 1
  3.  Dim strSQL As String    'set discard to true and InService to False for OldTire in the tires table
  4.                         strSQL = _
  5.                             "UPDATE tblTires " & _
  6.                             "SET tblTires.Discarded = True, tblTires.InService = False, tblTires.StockStatus = ""UnServicable"" " & _
  7.                             "WHERE (((tblTires.TireID) =" & intOldTire & "));"
  8.  
  9.                     CurrentDb.Execute strSQL, dbFailOnError
  10.  
  11. query 2
  12. Dim strInService As String      'set New Tire InService to True
  13.                         strInService = _
  14.                             "UPDATE tblTires " & _
  15.                             "SET tblTires.InService = True, tblTires.Discarded = False, tblTires.StockStatus = ""In Service"" " & _
  16.                             "WHERE (((tblTires.TireID) =" & intNewTire & "));"
  17.                 CurrentDb.Execute strInService, dbFailOnError
  18.  
  19. case 5
  20. query 1
  21. Dim CapStock As String         'set InService to False
  22.                     CapStock = _
  23.                         "UPDATE tblTires " & _
  24.                             "SET tblTires.Discarded = False, tblTires.InService = False, tblTires.StockStatus = ""Retread Stock"" " & _
  25.                             "WHERE (((tblTires.TireID) =" & intOldTire & "));"
  26.                 CurrentDb.Execute RemoveToStock, dbFailOnError
  27.  
  28. query 2
  29. Dim strInService5 As String                         'set New Tire InService to True
  30.                     strInService5 = _
  31.                         "UPDATE tblTires " & _
  32.                         "SET tblTires.InService = True, tblTires.Discarded = False, tblTires.StockStatus = ""In Service"" " & _
  33.                         "WHERE (((tblTires.TireID) =" & intNewTire & "));"
  34.                 CurrentDb.Execute strInService2, dbFailOnError
Jan 23 '14 #1

✓ answered by Luk3r

I may be way off here, but in query 1 of case 5 aren't you trying to execute a command (string) that doesn't exist? Shouldn't you be executing CapStock instead of RemoveToStock? The same goes for query 2 of case 5.

Share this Question
Share on Google+
3 Replies


100+
P: 299
I may be way off here, but in query 1 of case 5 aren't you trying to execute a command (string) that doesn't exist? Shouldn't you be executing CapStock instead of RemoveToStock? The same goes for query 2 of case 5.
Jan 23 '14 #2

P: 68
Yes you are right. I was focusing on the query and didn't see that.
Thanks
Jan 23 '14 #3

100+
P: 299
You're welcome and I'm glad I could help.
Jan 23 '14 #4

Post your reply

Sign in to post your reply or Sign up for a free account.