tylersontag
Registered User.
- Local time
- Yesterday, 21:50
- Joined
- Sep 2, 2009
- Messages
- 19
Alright, take a shot at this one.
I have a form; it opens up another form, and let’s calls it the Report form.
The report form has 3 embedded sub-forms. I'm trying to read a summation value in the footer section of each one of these subforms. The problem is that it takes about half a second to read the backend SQL database and compute this value.
This wait is killing me. These values are used in the closing events and it is possible for a very quick user to hit close before these values are computed, thus causing zero to be passed into the method referencing these fields.
Furthermore, I have a process that automates this process by opening the form then calling a handler to close the form. This ALWAYS results in the values not being computed properly prior to them being needed.
Now, sofar I’ve tried both a while loop and even a reference to kernel32 (Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)) to cause the btnExit_Click event to pause if these calculated values aren't filled out yet.
The problem with both is they take precedence over the computation I’m waiting on. I can SLEEP or loop for a solid ten seconds and still see a zero value in that field.
Is there any multithreaded approach I can take here?
I have a form; it opens up another form, and let’s calls it the Report form.
The report form has 3 embedded sub-forms. I'm trying to read a summation value in the footer section of each one of these subforms. The problem is that it takes about half a second to read the backend SQL database and compute this value.
This wait is killing me. These values are used in the closing events and it is possible for a very quick user to hit close before these values are computed, thus causing zero to be passed into the method referencing these fields.
Furthermore, I have a process that automates this process by opening the form then calling a handler to close the form. This ALWAYS results in the values not being computed properly prior to them being needed.
Now, sofar I’ve tried both a while loop and even a reference to kernel32 (Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)) to cause the btnExit_Click event to pause if these calculated values aren't filled out yet.
The problem with both is they take precedence over the computation I’m waiting on. I can SLEEP or loop for a solid ten seconds and still see a zero value in that field.
Is there any multithreaded approach I can take here?