Senin, 18 Desember 2023

[MSAccessProfessionals] Experiment with Timer & VBS

Hi,
 
This is an experimental task.
I wanted to call MS Access file's function from, from a VBS file.
It works good but when I again run the VBS, it opens ANOTHER instance of MS Access. (this is undesirable).

It should call the function without opening another MS Access file.
All subsequent calls to the function must be answered from the file already opened.
 
Idea's background;
The original idea is to avoid using TIMER inside MS Access file. Instead create a VBS that calls MS Access file's function.
That VBS is then added to Windows Task Scheduler. I hope this would help MS Access file remain stable.
 
TIA
~ozair 
 
 
'Code in the VBS file 
Set accessApp = CreateObject("Access.Application")
accessApp.OpenCurrentDataBase "C:\Users\ozair\Desktop\DB1.accdb"
accessApp.UserControl = true
accessApp.Run "HelloMsg"
 
 
'Function in MS Access file [Module]
Public Function HelloMsg()
    MsgBox "Hello World!", vbExclamation
End Function
 
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116505) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Tidak ada komentar:

Posting Komentar