ctackett6407
Board Regular
- Joined
- Mar 18, 2018
- Messages
- 66
- Office Version
- 365
- Platform
- Windows
Greetings Folks,
I have tried to figure this out but I've yet to come across something that will allow me to make this happen.
Every morning I have to open an Access File and press the "Run All" button which will do the macro that's found in the "Code" area.
Is there a way that I can setup Task Scheduler in Windows to run this automatically twice a day? it would be one less process I have to do and can be done before employees show up.
I have tried to figure this out but I've yet to come across something that will allow me to make this happen.
Every morning I have to open an Access File and press the "Run All" button which will do the macro that's found in the "Code" area.
Is there a way that I can setup Task Scheduler in Windows to run this automatically twice a day? it would be one less process I have to do and can be done before employees show up.
Code:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Private Sub cmdsyncrunall_Click()
'Dim lbwait
'Call DriveTest 'Module 'DriveSpace' checks for low drive space, F drive
On Error Resume Next 'Run All'
lbRCS.Caption = "Sync TNS with CIS"
'lbwait.Visible = True
RCS.Visible = False
lbupdate.Visible = True
lbRCS.Visible = True
cmdsyncrunall.Caption = "Wait"
lblwait.Visible = True
RCS.SourceObject = ""
lbrandate.Caption = ""
Dim I As Integer
Dim cl As Integer
Call metertype 'updates missing metertype 97 &109
Call meterclass 'updates GEKV2C meter class to 102
Call cmdpremise 'Premise
Call cmdacct 'Acct
Call cmdrate 'Rate
Call cmdcycle 'Cycle
Call cmduser2 'Updates Active Meters reading in TNS user2 notes
Call cmduser1 'Updates User1 field with DSI Collar SN#
Call cmduser6 'Updates DRU number in TNS user6 notes
Call cmdmissingmeter ' Updates missing meter#
Call delpendingcmds 'Deletes pending SDC Actions and Commands[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
'lbwait.Visible = False
'Call fhide[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
lbRCS.Caption = "TNS Desktop Applications"
cmdsyncrunall.Caption = "Run All"
RCS.Visible = True[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
With DoCmd
.SetWarnings False
.OpenQuery "Date_Update_Query"
.Close acQuery, "Date_Update_Query", acSaveYes
.OpenTable "Date_table"
.Close acTable, "Date_table", acSaveYes
.SetWarnings True
End With
cl = DCount("*", "Meter_Class_Service_Multiplier_Query")
'i = DCount("*", "Accts w/Inactive_Gens and Incorrect Rate Code")
DoCmd.OpenQuery "Estimated_Query"
DoCmd.OpenQuery "AMR_Missing_IntervalReads"[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
DoCmd.OpenForm "lookup Tasks Queries"[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
lbrandate.Caption = DLookup("todaydate", "Date_table", "key = 1")
Call countrecords
If RCS.SourceObject = "" Then lbupdate.Caption = "" Else lbupdate.Caption = "Inactive Gen Accts that needs Rate Change"
If cl > 0 Then DoCmd.OpenQuery "Meter_Class_Service_Multiplier_Query", acViewNormal[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]FinalNote = MsgBox("Sync Complete")[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
'isdone:
' Call cmdexit
End Sub[/FONT]