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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having code select default button in a pop-up warning message.

Status
Not open for further replies.

Scoob55k

Technical User
Nov 16, 2005
62
US
I am running a delete query and two append queries in my code. I get a warning message box both when the queries are deleting and going to add records to the table.

The response on the users part will always be "Yes" which is the default answer that I can continue by hitting the enter key.

How can have the code automatically select the "Yes" button without any user intervention? I've tried to look it up using HELP as well as my manuals, but I'm just not looking for or typing the correct values. Thanks!
 
DoCmd.SetWarnings = False
[... run your code here ...]
DoCmd.SetWarnings = True
 
Thank you much. I new it was simple, just couldn't figure it out. To be honest, I looked at the SetWarning deal, but wasn't sure enough to try. Thanks again!
 
How are ya Scoob55k . . .

If you want to permanently turn these messages off (don't want to keep setting in code):

[blue]Tools - Options - Edit/Find Tab - Confirm Section[/blue]

Remove the checks from [blue]Document deletions[/blue] and [blue]Action queries[/blue] . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top