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

DoComd.Echo does not work in Access 2007 1

Status
Not open for further replies.

TedRSki

Programmer
Oct 17, 2010
24
US
I am currently working with Access 2007 on a laptop with Windows XP. I wrote a macro and then converted it into VBA. I have a screen with just buttons on it. Each button performs a VB module. I have tried the Application.Echo False and the DoCmd.Echo False to shut off the action query messages that pop up when you run an action query. Portion of the code is below. I have users that just want to press a button and everything gets done but I still can not find a way to shut off the action query messages such as "You are about to delete records, do you wish to continue?"

Can someone help me? It has me puzzled for two days now and I have checked just about every forum out there.


Public Sub DelRecords()
On Error GoTo DelRecords_Err

' SHUT OFF ECHO MESSAGES
DoCmd.Hourglass True
DoCmd.Echo False

' ACCT CODES - DELETE_ACCT_CODES
DoCmd.OpenQuery "DELETE_ACCT_CODES", acViewNormal, acEdit
' TIME CLOCK GROUPS - DELETE_TM_CLK_GRPS
DoCmd.OpenQuery "DELETE_TM_CLK_GRPS", acViewNormal, acEdit
 
Don't forget to turn the warning back on with

Docmd.SetWarnings True

Even better is to use this:

' Show the Hourglass
DoCmd.Hourglass True

' ACCT CODES - DELETE_ACCT_CODES
CurrentDB.Execute "DELETE_ACCT_CODES",dbFailOnError
' TIME CLOCK GROUPS - DELETE_TM_CLK_GRPS
CurrentDB.Execute "DELETE_TM_CLK_GRPS", dbFailOnError

' Turn off Hourglass
DoCmd.Hourglass False


Boyd Trimmell aka HiTechCoach
Microsoft Access MVP
 
HiTechCoach, thank you. Your code helped out a lot. It is now working just the way I want it to work. I have worked with VBA and Excel before but this is my first Access system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top