By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

Thermometer form does not repaint - Access looses focus

P: n/a
I'm using Access 2002 on Windows XP PC, 500 megs ram, Front end/back
end app.

I have a simple form that draws a thermometer to indicate progress of
code that is running. The thermometer form sometimes stops advancing
(does not repaint) part way thru it's cycle. If you click the MS
Access window title bar during the cycle, the Access title bar
switches to Access Not Responding. But if I ctrl+Break to stop the
code it is indeed still running. The form just does not show the
progress.

Here's the Sub that changes the form. Meter is the name of the
thermometer form. Box3 is the rectangle on Meter. intPercent1To100
is the integer that controls the size of the rectangle.

Sub ShowMeter(strText As String, intPercent1To100 As Integer)
Dim frm1 As Form
Set frm1 = Forms!Meter
frm1!Box3.Width = intPercent1To100 / 100 * 3 * 1440
frm1!Text0 = strText
frm1.SetFocus
frm1.Repaint
End Sub

This seems to work when the the code is quick. But if the thermometer
is going to take several minutes, then it sometimes stops responding.

Seems like an Access bug. Any help would be appreciated. I've seen
Knowledge Base article 242017 but my form is not modal and I'm not
using an ActiveX.exe.

Joe A
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Joe A" <ja****@arenasoft.com> wrote in message
news:a1*************************@posting.google.co m...
I'm using Access 2002 on Windows XP PC, 500 megs ram, Front end/back
end app.

I have a simple form that draws a thermometer to indicate progress of
code that is running. The thermometer form sometimes stops advancing
(does not repaint) part way thru it's cycle. If you click the MS
Access window title bar during the cycle, the Access title bar
switches to Access Not Responding. But if I ctrl+Break to stop the
code it is indeed still running. The form just does not show the
progress.

Here's the Sub that changes the form. Meter is the name of the
thermometer form. Box3 is the rectangle on Meter. intPercent1To100
is the integer that controls the size of the rectangle.

Sub ShowMeter(strText As String, intPercent1To100 As Integer)
Dim frm1 As Form
Set frm1 = Forms!Meter
frm1!Box3.Width = intPercent1To100 / 100 * 3 * 1440
frm1!Text0 = strText
frm1.SetFocus
frm1.Repaint
End Sub


I don't know if this will help but try adding a line with DoEvents before
you repaint the form.




Nov 13 '05 #2

P: n/a
John,

Yes!!! :o) You fixed it! :o)

I added
OpenForms = DoEvents ' Yield to operating system.

before the Repaint. Works great! This problem has plagued me for
years. Sometimes when my meter form stops responding the user thinks
my App has frozen and quits the App. If this happens while the code
in the backround is running (perhaps querying the back end file, this
could cause the back end file to get corrupted. Very Bad situation.
Thanks for your help.

Joe A

"John Winterbottom" <as******@hotmail.com> wrote in message news:<2h************@uni-berlin.de>...
"Joe A" <ja****@arenasoft.com> wrote in message
news:a1*************************@posting.google.co m...
I'm using Access 2002 on Windows XP PC, 500 megs ram, Front end/back
end app.

I have a simple form that draws a thermometer to indicate progress of
code that is running. The thermometer form sometimes stops advancing
(does not repaint) part way thru it's cycle. If you click the MS
Access window title bar during the cycle, the Access title bar
switches to Access Not Responding. But if I ctrl+Break to stop the
code it is indeed still running. The form just does not show the
progress.

Here's the Sub that changes the form. Meter is the name of the
thermometer form. Box3 is the rectangle on Meter. intPercent1To100
is the integer that controls the size of the rectangle.

Sub ShowMeter(strText As String, intPercent1To100 As Integer)
Dim frm1 As Form
Set frm1 = Forms!Meter
frm1!Box3.Width = intPercent1To100 / 100 * 3 * 1440
frm1!Text0 = strText
frm1.SetFocus
frm1.Repaint
End Sub


I don't know if this will help but try adding a line with DoEvents before
you repaint the form.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.