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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|