Solved

A pause needed before autoexec macro.

Posted on 2000-03-15
11
377 Views
Last Modified: 2010-07-27
This is a strange one.
Using a hyperlink from IE5 to an MDB file - it boots twice. I boots normally from Windows Explorer.
I finally tracked the problem down to the autoexec macro. If I remove this then the MDB boots once. All I can figure is that somehow the autoexec is firing off too quickly and causing the MDB to reload.
SO - I would like to get a pause in somehow before the autoexec macro kicks off.
0
Comment
Question by:capital052798
  • 4
  • 2
  • 2
  • +2
11 Comments
 
LVL 10

Accepted Solution

by:
paasky earned 30 total points
Comment Utility
Hello capital,

Here's one work-around you could try:

Rename Autoexec macro, then define a startup form (choose Tools | Startup..) which will open when database is opened. Set timerinterval of that form to 1000 and execute the renamed macro OnTimer event.

Hope this helps,
Paasky
0
 
LVL 2

Expert Comment

by:mrt1
Comment Utility
I think you'll get the error whether you use autoexec or Tools/Startup.

This is a bug with IE5 and MS Access....

Have at look at this MS support article:

http://support.microsoft.com/support/kb/articles/Q186/3/08.ASP?LNG=ENG&SA=TECH&FR=1)

I also tried to get around it using Tools/startup and by adding time delays......didn't have any success, though.
0
 
LVL 4

Expert Comment

by:wesleystewart
Comment Utility
..And then make sure to close the form so the macro doesn't keep executing every 1000 ms... :-)

Wes
0
 
LVL 10

Expert Comment

by:paasky
Comment Utility
Good addition to my comment Wes! :-)

If you don't want to close startup form you can disable Timer with this code:

  ...
  Me.TimerInterval = 0
End Sub

Paasky
0
 
LVL 1

Expert Comment

by:EvanL
Comment Utility
Don't know if it helps, but I use this code to pause:

    Dim StartTime As Single
    Dim x As Integer
   
    'Set the time in seconds to pause
    x = 1
   
    'Set the start time variable
    StartTime = Timer + x
   
    'Do events
    Do While Timer < StartTime
        DoEvents
    Loop
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:capital052798
Comment Utility
mrt1
I'm sorry to say this but mrt1 is right.
Paasky's suggestion for the startup form was interesting to me as I didn't know it existed - thanks. I set it up, put the timer on, in fact I set the timer up to 10,000 milli secs - but still the same old double boot.
0
 
LVL 1

Expert Comment

by:EvanL
Comment Utility
The Microsoft solution did not help?
0
 
LVL 2

Expert Comment

by:mrt1
Comment Utility
The microsoft solution will work, but moving your database onto a web server or creating a "virtual directory" is not always practical or desirable.

I think we're stuck with this Microsoft "feature".

0
 
LVL 10

Expert Comment

by:paasky
Comment Utility
capital,

I also read the Micro$oft article after sending my suggestion. Thank you mrt1 giving us that information.

It was mentioned there that both Autoexec and startup form will cause multiple start problem. Seems that VBA library is causing trouble with IE3 <

Nasty bug I have to say..

Regards,
Paasky
0
 

Author Comment

by:capital052798
Comment Utility
Passky
whilst I didn't get my problem solved - you answered my question re the pause on start up - so you get the points. Thanks
0
 
LVL 10

Expert Comment

by:paasky
Comment Utility
Happy to help with pause issue capital - sorry your loading-twice problem was  not solved. Let's hope MS would offer a patch for this unpleasant feature soon).

Regards,
Paasky
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now