We help IT Professionals succeed at work.

MS Access Macro Execution on Forms Timer

t87994
t87994 asked
on
Medium Priority
481 Views
Last Modified: 2012-08-13
I have an Access database (2000 version) running on my plant floor which rotates a series of form displays.  The rotation of the open / close of the forms is controlled by a macro that executes every 10 seconds using the timer event property on forms.  Occassionally, the macro failes to execute resulting in the display showing a "HALT" message.  This is rare...i can count on one hand how many times the rotation has stoped (since November 2010 when we deployed the application) and as a result, I am unalbe to determine why the error is occuring.  Any thoughts?  The only way to fix the HALT error is to close and reopen the database.  The DB is split, with 5 copies of front ends running on PC's linked to back end tables which resides on our local server / share, but only one PC services the 4 monitor / displays running the rotation sequence.  Thanks.
Comment
Watch Question

conagramanrock star

Commented:
wow.. that could be anything.

your right if it happened before it will happen again- maybe put an error handler in to try and catch the error if it ever happens again.
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
The timer is a funny monster.
It ONLY runs when the app is active and the form is the active form.

Windows update notifier?
Outlook task?
Java update
Acrobat update.

The HALT is something that I run into when I open a db on one machine that has it's references in different spots than another, or different Access versions.
Generally, you compile on the dev machine and push out the front ends.

What happens if you try to compile the code in the VBA|debug|compile option on each of the machines?
Does it compile on them all?
You may have to change a tiny bit of code to permit a compile to be done.
If not, then your app is very infrequently running a bit of code that won't work on that particular machine

Author

Commented:
Maybe i should convert the macro that handles the form open/close routine to vba...?
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
Maybe.
Can you post the macro?
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
Yes, this sounds like a "Timing" (no pun intended) error.

The Timer itself is not perfect, and is a bit of a resource hog.
As such, it can get tripped up by other applications that are a resource intensive.
(Antivirus, Web Browser, system functions,...etc)

This is yet another reason to move away from Macros and use VBA.
VBA has much more robust error handling and debugging tools.

So, yes, please post the macro.

JeffCoachman

Author

Commented:
Thanks Jeff.  As we've progressed with the development of this great system, we've seen the benefit to VBA vs. a bunch of macros.  This is definately a to do.  The Macro converted seems simple enough.  Interested in your thoughts.  Thanks again.  Here is the Macro code:

'------------------------------------------------------------
' mcrOnTimerCountDaysAV
'
'------------------------------------------------------------
Function mcrOnTimerCountDaysAV()
On Error GoTo mcrOnTimerCountDaysAV_Err

    DoCmd.Close acForm, "frmPressGroupOutputDaysMonitorAV1"
    DoCmd.OpenForm "frmPressStatusMonitor1AV", acNormal, "", "", acReadOnly, acNormal
    Exit Function


mcrOnTimerCountDaysAV_Exit:
    Exit Function

mcrOnTimerCountDaysAV_Err:
    MsgBox Error$
    Resume mcrOnTimerCountDaysAV_Exit

End Function
MIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I will convert all timer event routines to VBA and keep an eye out for the issue.  PC / network updates may be the cause of the issue, as these occur at rarely scheduled intervals over the network when necessary and since we just leave the Db running constantly, even over the weekends, the updates may interfere somehow with the timer events.  Thanks for your help.

Author

Commented:
Still unknown factors; however, using VBA vs. macro will allow flexibiility for better error handling explanations.
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
<macro will allow flexibiility for better error handling explanations.>
No, if you want *True* flexibility for error handling explanations, you must use VBA (not Macros).
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.