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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Change the Sub into a Function.

You can then use RunCode in your macro to fire it off.
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top