Scheduled Task : Press "Yes" Control Pop-Up Automatically for a "Delete" SQL event

  • Thread starter Thread starter A Techie
  • Start date Start date
A

A Techie

All --

Hello !

I've got a scheduled task running on Windows 2000 server in conjunction
with Access 2000 to run a macro which deletes a group of records.

This macro runs perfectly excepting for the fact that a prompt occurs
asking if one would like to delete those records.

How do I automate this portion of my macro to 'click on the YES button'?

I've been playing with the 'SendKeys' action within the Access 2000
macro to no avail.

Any ideas or suggestions would be very, very cool.

Thanks, Best,

-- B.
 
A Techie,
I think you're referring to the Access "warning" prompt that appears
whenever you delete a record.
Check out SetWarnings in Help. It allows you to suspend "action query"
warnings. (MakeTable, Updates, Dels, etc...)

DoCmd.SetWarnings False 'Action query msgs will not appear
'Your deletion code here
DoCmd.SetWarnings True 'Turn it back On again
 
A Techie said:
All --

Hello !

I've got a scheduled task running on Windows 2000 server in conjunction
with Access 2000 to run a macro which deletes a group of records.

This macro runs perfectly excepting for the fact that a prompt occurs
asking if one would like to delete those records.

How do I automate this portion of my macro to 'click on the YES button'?

I've been playing with the 'SendKeys' action within the Access 2000
macro to no avail.

If you use the Execute method to run the query instead of DoCmd, then you will
not get a prompt.

CurrentDB.Execute "YourQueryName", dbFailOnError
 
Back
Top