Solved

Runtime error '3078' even though SQL string appears correct

Posted on 2003-12-02
5
542 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

829 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