Solved

Runtime error '3078' even though SQL string appears correct

Posted on 2003-12-02
5
543 Views
Last Modified: 2008-02-01
Experts,

Could someone shed some light on this little problem. Below is the VBA code used to update the delivery date fields for a customer in a table called tbl_temp_orders. It is executed after the date within the tbx_clients_nextcall  textbox is changed on a form.

I have checked the resulting strSQL using MsgBox and all seems perfect BUT i get the following error:  

Runtime error '3078'
The Microsoft Jet Database Engine cannot find the input table or query ". Make sure it exists and that its mane is spelled correctly.

Thanks in Advance

Jason




Sub UpdateDeldate_TempOrdersTable()
Dim strSQL As String
 
'Create SQL string to update the deldate in tbl_temp_orders when the delivery date is changed
strSQL = "UPDATE tbl_temp_orderentry SET tbl_temp_orderentry.deldate = #" & Format$(Me.tbx_clients_nextcall, "mm\/dd\/yyyy") & "# WHERE (tbl_temp_orderentry.code) = '" & Trim(Me!code) & "';"

'Execute strSQL
DBEngine(0)(0).Execute strSQL1, dbFailOnError

End Sub
0
Comment
Question by:jason_pleaner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 10

Assisted Solution

by:ADSaunders
ADSaunders earned 50 total points
ID: 9856675
Hi jason_pleaner,

???
tbl_temp_orders (in your description)
UPDATE tbl_temp_orderentry .... (in your SQL)
???

Regards .. Alan
0
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 135 total points
ID: 9856996
Try:

strSQL = "UPDATE tbl_temp_orderentry SET deldate = #" & Format$(Me!tbx_clients_nextcall, "mm/dd/yyyy") & "# WHERE code = '" & Trim(Me!code) & "'"

Field code is string, right?

Later on you can change to mm\/dd\/yyyy if necessary.

Mike
0
 
LVL 17

Assisted Solution

by:Natchiket
Natchiket earned 50 total points
ID: 9856999
Try putting a breakpoint in after strSQL has been formulated, copy the contents of strSQL from the immediate window and paste it into a query, and see if it runs from there.  You may get a more informative error description
0
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 135 total points
ID: 9857006
Btw, you don't need $ in:

Format(Me!tbx_clients_nextcall, "mm/dd/yyyy")
0
 

Author Comment

by:jason_pleaner
ID: 9863942
Thanks all,

At the end of the day I figured out another way to do it.

Jason
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question