Queennie L
asked on
Execute a command button in MS Access using Task Scheduler
I want to schedule a onclick event command button to fire up automatically in MS Access using Task Scheduler.
Please help.
Thank you.
Please help.
Thank you.
You need to add a LOT more detail to your question!Agree with Nick...
Also note that you must carefully consider what you want to happen if:
The task scheduler fails to run (for any reason)
The code fails to run (for any reason)
The PC is powered down.
Remember that there is no real "notification" in the task scheduler to alert you if something goes wrong...
In some cases you may never know the task failed, ...possibly letting you go for months with invalid data...
JeffCoachman
ASKER
Hello Nick,
I have a code in vb.net that use "autoimport" in task scheduler but I don't know how to do this in MS Access.
Code in VB.net:
Then I created a Task to auto run the command button. This how I created in Task Scheduler:
Action Tab:
Start a program
Program/Script:
\\network\applications\Pro gram.exe
Add arguments:
autoimport =>>> this will click the command button in my Program.exe
I hope this makes sense.
Thank you.
I have a code in vb.net that use "autoimport" in task scheduler but I don't know how to do this in MS Access.
Code in VB.net:
Private gAutoImport As Boolean
Private Sub frmimport_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
If LCase(VB.Command()) = "autoimport" Then
gAutoImport = True
Call cmdImport_Click(cmdImport, New System.EventArgs())
Me.Close()
End
Else
gAutoImport = False
End If
End Sub
Then I created a Task to auto run the command button. This how I created in Task Scheduler:
Action Tab:
Start a program
Program/Script:
\\network\applications\Pro
Add arguments:
autoimport =>>> this will click the command button in my Program.exe
I hope this makes sense.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
...So you need to make sure that you have "rock solid" error handling in all of your code...
ASKER
I got it working.
Thanks.
Thanks.
Good to hear!
Jim.
Jim.
ASKER
Thanks Jim.
I gave you the credit since the video gave me an idea how to fire the command button.
I really appreciate your help.
I gave you the credit since the video gave me an idea how to fire the command button.
I really appreciate your help.
Getting it to run in a bulletproof fashion via the Task Scheduler is possible but fraught with ways to go wrong.
What is in the OnClick event?
Will Access remain open?
Will the user always be logged on?
Will Access remain the active task?
You need to add a LOT more detail to your question!