automate macro run via switch input, rather than button click

C

connelly01

I presently have a macro that is run via clicking a form button. I need to
automate the process by replacing someone having to manually click the button
with an input from a photo eye switch, or proximity switch. My initial
thought is for Access to constantly monitor for a 0 or 1, or On or Off coming
from the switch, then respond accordingly by running the macro? Has anyone
done something similar? Any suggestions for how I can manipulate Access to
accomplish this automation?

Thank you.
 
J

jl5000

Does your switch sends a signal that you can capture? if so use this signal
to open access to runa any macro inside your database and close the database
instead of having access check the switch
 
C

connelly01

Our database needs to remain open all of the time, except for maintenance. I
think I would have to interface the switch data to the Access field via OLE.
If I can get the data from the switch to read into a field in Access could I
then write some code, like a loop or something, that would constantly check a
field for a 1 or 0, or On or Off. For example: If switchData = 1 Then
runMacro Else do Loop. What do you think about this?
 
J

jl5000

I'm not familiar with extracting info frol OLE objects, but if your swich can
generate a text file as a log file, you can have the database import that log
every so often
 

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

Top