A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

msgbox and SQL statement



 
 
Thread Tools Display Modes
  #1  
Old June 24th, 2004, 11:21 PM
Dan
external usenet poster
 
Posts: n/a
Default 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  
Old June 25th, 2004, 01:01 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 06:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.