macro to run on click event procedure

Mike Hughes

Registered User.
Local time
Today, 03:29
Joined
Mar 23, 2002
Messages
493
I have a form with a comman button with an on click event procedure shown below. It runs and emails several reports each time I run it. I would like to know if there is a way to set this up so it would run each day at a set time without me being at the computer. (as long as the computer is running). I'm sure it must have something to do with macros and Scheduled Tasks in Windows, but I don't know how to accomplish what I want to do.



Option Compare Database

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim stDocName As String

stDocName = "CHECK RECIPIENTS NOT 3600000 FIPS"
DoCmd.RunMacro stDocName

stDocName = "BORN OUT OF WEDLOCK NO PAT EST BLANK"
DoCmd.RunMacro stDocName

stDocName = "BORN OUT OF WEDLOCK YES PAT EST BLANK"
DoCmd.RunMacro stDocName

stDocName = "BORN OUT OF WEDLOCK YES - PAT EST L"
DoCmd.RunMacro stDocName

stDocName = "SET WARNINGS NO"
DoCmd.RunMacro stDocName
stDocName = "ALL CASES NOT CLOSED Q"
DoCmd.OpenQuery stDocName

stDocName = "SET WARNINGS NO"
DoCmd.RunMacro stDocName
stDocName = "ALL CASES WITH NCP OR PF Q"
DoCmd.OpenQuery stDocName

stDocName = "SET WARNINGS NO"
DoCmd.RunMacro stDocName
stDocName = "ALL CASES NOT CLOSED Without Matching ALL CASES WITH NCP OR PF Q"
DoCmd.OpenQuery stDocName

stDocName = "SET WARNINGS NO"
DoCmd.RunMacro stDocName
stDocName = "CLIENT FOR UNMATCHED CASES Q"
DoCmd.OpenQuery stDocName

stDocName = "SET WARNINGS NO"
DoCmd.RunMacro stDocName
stDocName = "CASES WITH NO MEMBERS Q"
DoCmd.OpenQuery stDocName

stDocName = "CASES WITH NO MEMBERS"
DoCmd.RunMacro stDocName

stDocName = "SORD WITHOUT OBLE"
DoCmd.RunMacro stDocName

stDocName = "CASES WITH A COURT ID ORDER TYPE MISMATCH"
DoCmd.RunMacro stDocName

stDocName = "OPEN CASES LISTING NCP AND CP MEMBER NUMBER Q"
DoCmd.OpenQuery stDocName, acNormal, acEdit

stDocName = "CASES WITH NCP WHERE DEP UNDER 18 NO FATHER'S LN ON DEMO"
DoCmd.RunMacro stDocName

stDocName = "CASES WITH CP WHERE DEP UNDER 18 NO MOTHER'S LN ON DEMO"
DoCmd.RunMacro stDocName

stDocName = "SET WARNINGS NO"
DoCmd.RunMacro stDocName
stDocName = "1 CASES NOT CLOSED WITH NCP"
DoCmd.OpenQuery stDocName

stDocName = "SET WARNINGS NO"
DoCmd.RunMacro stDocName
stDocName = "2 CASES WITH NCP AND ALSO ACTIVE PF"
DoCmd.OpenQuery stDocName

stDocName = "CASES WITH NCP AND ACTIVE PF"
DoCmd.RunMacro stDocName



Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom