Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 614
  • Last Modified:

Delay a macro until after form is fully loaded and displayed

I have an opening splash screen that I want to display when the application is first opened then to run a macro. The macro runs 6 different import queries.

No matter what I try only one small corner of the form has time to display before the macro executes. Once the macro is finished then the form fully appears. I want the reverse, the form to fully display (it tells the user to wait, that there is processing goin on) then run the macro.

Any suggestions?
0
awilson1199
Asked:
awilson1199
  • 2
1 Solution
 
PsychoDazeyCommented:
Have you tried putting the macro in the OnCurrent event?
If that doesnt work, in the on current event for the form set the timer = to 2500 (or something like that), I believe the syntax is Me.timer = 2500.
Then, in the on timer event, set the timer = 0 and put the code in to run the macro.
Let me know if you need me to walk you through this.
1
 
mgrattanCommented:
You can execute your macro from the form's On Load event.  

Public Sub Form_Load()
   Me.Repaint
   DoCmd.RunMacro "macro name"
End Sub
0
 
awilson1199Author Commented:
I had tried putting the macro in the OnCurrent, onActive, gotfocus... But I tried the timer solution and it works. Thanks
0
 
PsychoDazeyCommented:
No problem, glad I could help!
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now