Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Runtime error '3078' even though SQL string appears correct

Posted on 2003-12-02
5
Medium Priority
?
546 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 150 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 405 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 150 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 405 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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…

661 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