A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DoEvents and Execution



 
 
Thread Tools Display Modes
  #1  
Old March 24th, 2010, 07:14 PM posted to microsoft.public.access
PeterM
external usenet poster
 
Posts: 208
Default DoEvents and Execution

I'm using AC2003. I have FormA which has two subform controls on it which do
not have a SourceObject assigned to them. I do that in the form_open event,
see below. What I'm trying to do is to open a simple OneMomentPlease form
that has several colored labels used to indicate progress. As I understand
it, a DoEvents statement should force all statements prior to it to execute
before any following statements to execute. However, it's not working that
way. When FormA is opened it runs through all statements. Each sourceobject
contains a fairly complex chart and takes 3-5 seconds to open each one. I
want to let users know that the system is working and not waiting for them.

Any help would be appreciated.


Private Sub Form_Open(Cancel As Integer)
Me.Child1.SourceObject = "chartcarbs"
DoCmd.OpenForm "OneMomentPlease", acNormal, , , acFormEdit
Forms!OneMomentPlease.Form!Label5.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoEvents
Me.Child2.SourceObject = "chartcalories"
Forms!OneMomentPlease.Form!Label6.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoCmd.Close acForm, "OneMomentPlease"
DoEvents
End Sub

  #2  
Old March 24th, 2010, 08:36 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default DoEvents and Execution

DoEvents allows Windows to do things. It passes control to the OS and not the
database.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"PeterM" wrote:

I'm using AC2003. I have FormA which has two subform controls on it which do
not have a SourceObject assigned to them. I do that in the form_open event,
see below. What I'm trying to do is to open a simple OneMomentPlease form
that has several colored labels used to indicate progress. As I understand
it, a DoEvents statement should force all statements prior to it to execute
before any following statements to execute. However, it's not working that
way. When FormA is opened it runs through all statements. Each sourceobject
contains a fairly complex chart and takes 3-5 seconds to open each one. I
want to let users know that the system is working and not waiting for them.

Any help would be appreciated.


Private Sub Form_Open(Cancel As Integer)
Me.Child1.SourceObject = "chartcarbs"
DoCmd.OpenForm "OneMomentPlease", acNormal, , , acFormEdit
Forms!OneMomentPlease.Form!Label5.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoEvents
Me.Child2.SourceObject = "chartcalories"
Forms!OneMomentPlease.Form!Label6.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoCmd.Close acForm, "OneMomentPlease"
DoEvents
End Sub

  #3  
Old March 24th, 2010, 08:42 PM posted to microsoft.public.access
PeterM
external usenet poster
 
Posts: 208
Default DoEvents and Execution

Is there any way to do what I need?

"Jerry Whittle" wrote:

DoEvents allows Windows to do things. It passes control to the OS and not the
database.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"PeterM" wrote:

I'm using AC2003. I have FormA which has two subform controls on it which do
not have a SourceObject assigned to them. I do that in the form_open event,
see below. What I'm trying to do is to open a simple OneMomentPlease form
that has several colored labels used to indicate progress. As I understand
it, a DoEvents statement should force all statements prior to it to execute
before any following statements to execute. However, it's not working that
way. When FormA is opened it runs through all statements. Each sourceobject
contains a fairly complex chart and takes 3-5 seconds to open each one. I
want to let users know that the system is working and not waiting for them.

Any help would be appreciated.


Private Sub Form_Open(Cancel As Integer)
Me.Child1.SourceObject = "chartcarbs"
DoCmd.OpenForm "OneMomentPlease", acNormal, , , acFormEdit
Forms!OneMomentPlease.Form!Label5.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoEvents
Me.Child2.SourceObject = "chartcalories"
Forms!OneMomentPlease.Form!Label6.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoCmd.Close acForm, "OneMomentPlease"
DoEvents
End Sub

  #4  
Old March 25th, 2010, 02:16 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default DoEvents and Execution

You could open a form setting both the Modal and PopUp properties to Yes.
Then use this form's Timer event close the form in a few seconds. Modal and
PopUp will block users from doing anything until the form closes.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"PeterM" wrote:

Is there any way to do what I need?

"Jerry Whittle" wrote:

DoEvents allows Windows to do things. It passes control to the OS and not the
database.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"PeterM" wrote:

I'm using AC2003. I have FormA which has two subform controls on it which do
not have a SourceObject assigned to them. I do that in the form_open event,
see below. What I'm trying to do is to open a simple OneMomentPlease form
that has several colored labels used to indicate progress. As I understand
it, a DoEvents statement should force all statements prior to it to execute
before any following statements to execute. However, it's not working that
way. When FormA is opened it runs through all statements. Each sourceobject
contains a fairly complex chart and takes 3-5 seconds to open each one. I
want to let users know that the system is working and not waiting for them.

Any help would be appreciated.


Private Sub Form_Open(Cancel As Integer)
Me.Child1.SourceObject = "chartcarbs"
DoCmd.OpenForm "OneMomentPlease", acNormal, , , acFormEdit
Forms!OneMomentPlease.Form!Label5.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoEvents
Me.Child2.SourceObject = "chartcalories"
Forms!OneMomentPlease.Form!Label6.Visible = True
DoCmd.RepaintObject acForm, "OneMomentPlease"
DoCmd.Close acForm, "OneMomentPlease"
DoEvents
End Sub

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.