How do i create a Function procedure that calls the Sub procedure

R

Raymond

I have a working sub procedure, it is called: Sub SendMessage()

I do not know to much about VB so details would be appreicated.

I am trying to create a macro that kicks off this sub code (procedure) when
the DB is opened from a Windows Scheduled Task.

Thanks,

Raymond
 
A

Allen Browne

Change the Sub into a Function.

You can then use RunCode in your macro to fire it off.
 
R

Roger Carlson

Specifically, you use the RunCode action in the macro (let's call it
AutoRun) to run the function. In the command line, you use the /X switch to
run the macro:

C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE C:\My
Documents\RemoteMacro.mdb /xAutoRun

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
R

Raymond

Thank you. That worked

Roger Carlson said:
Specifically, you use the RunCode action in the macro (let's call it
AutoRun) to run the function. In the command line, you use the /X switch to
run the macro:

C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE C:\My
Documents\RemoteMacro.mdb /xAutoRun

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Top