Solved

Runtime error '3078' even though SQL string appears correct

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

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 33

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

831 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