473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Thermometer form does not repaint - Access looses focus

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
2 5112
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
1
by: VM | last post by:
I'm working on a web form that displays the temperature of a certain room and I'd like to display the temperature as a thermometer where I send it the value (eg. 78 degrees F) and the thermometer...
1
by: Robert Clark | last post by:
This a pocket pc/smartphone questions mainly, but i thought i'd ask the question in the C# newsgroup. I have a form which i use to display information from a web service. From this form i open...
6
by: sandy_pt_in | last post by:
Hi, I have modal form which I am showing with some fading effect... (it is like balloon that comes when you receive a mail in the outlook.) But when I show this form, Owner form looses focus. I...
2
by: Vasilis X | last post by:
Hello. I am using vb.net. On a form i have a picture box and i draw points, lines, arcs etc in it. When i minimize the form and then maximize it again or if the form looses the focus for any...
2
by: rdemyan via AccessMonster.com | last post by:
I have a custom message form that I want to display when the user shuts down my app. Some clean up needs to be done during shutdown and I want to display this form and then display various...
0
by: =?Utf-8?B?TWljaGFlbA==?= | last post by:
Hi Everyone, I have an issue thats bugging me some. I have a search form that I created to search for clients in the database from the Client form. User selects the client from a list and the...
19
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what it should do when the user changes tabs. But...
1
by: sconard | last post by:
When you create a form based on a table via access 2007 wizard, form will update when moving from field that has changed to another field within form. Each loss of focus in "changed" fields causes...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.