473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

update query error 3078

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.

3 1444
Luk3r
300 256MB
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
Yes you are right. I was focusing on the query and didn't see that.
Thanks
Jan 23 '14 #3
Luk3r
300 256MB
You're welcome and I'm glad I could help.
Jan 23 '14 #4

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

Similar topics

1
by: Norman Mooradian | last post by:
Does anyone know if Visual Basic.NET solves a problem in VB6. In VB6, there is a problem using the Jet engine to access an oracle database that results in error 3078?
4
by: Lisa | last post by:
can someone tell me what is wrong with this query? I've tried every combo that I can think of - adding &,"", "'", ) everywhere I can think of and I keep getting an 'Expected end of statement...
2
by: Steve Bishop | last post by:
I'm having problems using an update query. I get the error: Server: Msg 8152, Level 16, State 9, Procedure SP_MemberUpdate, Line 3 String or binary data would be truncated. The statement has been...
4
by: deko | last post by:
I'm trying to update the address record of an existing record in my mdb with values from another existing record in the same table. In pseudo code it might look like this: UPDATE tblAddress SET...
7
by: Mark Carlyle via AccessMonster.com | last post by:
I have this update query that I am trying to run. I know the syntax is messed up but do not know how to correct it. Select 'UPDATE', Transactions,'Set = where = ' From "Get Daily Balances" ...
2
by: Reedsp | last post by:
OS: MS XP Access version: 2003 SP2 I am trying to use an update query to replace quote marks with nothing. In essence, I'm removing quote marks. I get a error message when a field is empty or...
2
MindBender77
by: MindBender77 | last post by:
Hello again, All... Admin's, I wasn't sure where to post this, please move if in wrong forum. I'm using FrontPage 2003 to post form data to a second form to be used in an update query. The query...
2
by: Pratik Somani | last post by:
When i am running this query its gvng an syntax error near where statement.. SqlCommand cmd2 = new SqlCommand("Update Personal_Profile set city='" + txtcity.Text + "',"+"hometown='" + txttown.Text...
2
by: Knowlton | last post by:
I have an update query that runs from an option group. I added another option and the update query for that option. This query is the same as another option so I copied it from the existing option....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.