Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Eliminating Dialog Boxes When Running SQL from VBA

Status
Not open for further replies.

oakleaf8

IS-IT--Management
May 16, 2002
57
0
0
US
If I run SQL in a VBA pushbutton from a form to Update, Ammend and/or Delete Records to tables from a pushbutton form, I get dialog boxes I don't want.

I want (with one click), my form data put amended to, updating or deleting appropriate records without having to respond to each of those boxes. Possible?
 
[tt]docmd.setwarnings false
' perform your sql
docmd.setwarnings true[/tt]

Roy-Vidar
 
How are ya oakleaf8 . . . . .

To [blue]permanently turn off warnings[/blue], in the database window:

[purple]Tools[/purple] - [purple]Options[/purple] - [purple]Edit/Find Tab[/purple]. In the [blue]Confirm section[/blue], remove check from [blue]Action queries[/blue].

Calvin.gif
See Ya! . . . . . .
 
or the final way:
Code:
currentdb.execute "YOUR SQL" ,dbfailonerror

If you don't want an error message to show if the sql fails, get rid of the end bit.

hth

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
Want to get great answers to your Tek-Tips questions? Have a look at F
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top