If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
msgbox and SQL statement
I am executing the statement:
CurrentDb.Execute strSQL, dbFailOnError I was just wondering if the database fails what happens. I need it to give at least some kind of message. How can I at least get a message box to pop up? |
#2
|
|||
|
|||
msgbox and SQL statement
Put error trapping in your routine.
Sub MySub() On Error GoTo Err_MySub .... CurrentDb.Execute strSQL, dbFailOnError .... End_MySub: Exit Sub Err_MySub: MsgBox Err.Description & " (" & Err.Number & ")" Resume End_MySub End Sub -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Dan" wrote in message ... I am executing the statement: CurrentDb.Execute strSQL, dbFailOnError I was just wondering if the database fails what happens. I need it to give at least some kind of message. How can I at least get a message box to pop up? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ctrl-V to text box locks up SQL statement in code? | Alicia | Using Forms | 2 | June 17th, 2004 02:10 AM |
searching for a function or SQL statement | Elise | General Discussion | 4 | June 14th, 2004 08:09 AM |
urgent help for build sql statement in vba | terry | Running & Setting Up Queries | 1 | June 4th, 2004 05:01 PM |