472,353 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

label is not visible on form

This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visible = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Caption = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visible = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 25 '07 #1
5 11039

I assume this is all happening in the same procedure? Try adding a
Repaint after setting the visible property. Repaint is to graphically
redraw the form. Refresh is related to data.

Me.lblWait.Visible = True
Me.Repaint

Mar 25 '07 #2
I *think* that the problen is that a label is a form object, if I recall
correctly.
I used a textbox and (using a Wait() function that I found somewhere -
Access Web?) gave it a 2-second delay so that the user had time to read it
before moving on to the next operation.

Me![txtProgress].Visible = True
Me![txtProgress].SetFocus
Me![txtProgress].Text = "Testing Data Path"
Me.Refresh
DoCmd.Beep
Me![txtProgress].SelStart = 0
Wait 2, False

Here is the Wait() function:

'================================================= ==================
' NOTE: In Visual or Access Basic the unit of greatest precision
' is seconds. Therefore if the Timer is set to wait one second, the
' result could be a delay of anywhere from 0 to 1 second. If a higher
' degree of precision is required, another option is to use the Timer
' event of the form which has the ability to trigger every 1000th of a
' second.
'================================================= ===================

Function Wait(Delay As Integer, DispHrglass As Integer)

Dim DelayEnd As Double
DoCmd.Hourglass DispHrglass
'(In Microsoft Access 2.0 and 1.x use: DoCmd Hourglass DispHrglass)
DelayEnd = DateAdd("s", Delay, Now)
While DateDiff("s", Now, DelayEnd) 0
Wend
DoCmd.Hourglass False
'(In Microsoft Access 2.0 and 1.x use: DoCmd Hourglass False)

End Function

HTH,
Don

<dg******@twcny.rr.comwrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visible = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Caption = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visible = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 25 '07 #3
dg******@twcny.rr.com wrote:
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visible = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Caption = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visible = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah
Yes. What is the Caption before you make it visible? If Null or a
space it would display but you wouldn't know unless it had a border.

I'd do this test if its another problem. Make the label visible when
you open it. Comment out (for testing only) the SQL manipulation so the
New Caption line executes. Does it work? I don't believe it has
anything to do with your SQL process but I could be wrong.
Mar 25 '07 #4
DoEvents yields control to the system, so it can perform functions that are
waiting to occur, for example, updating the Visibilty or content of your
Label Control. I am not certain about the other suggestions, as some "system
requests" from VBA code are just queued up waiting for the OS to get control
again (as it does with DoEvents... for which see the Help in any module
window).

Larry Linson
Microsoft Access MVP

<dg******@twcny.rr.comwrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visible = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Caption = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visible = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 25 '07 #5
Thank you very much. Both of the first 2 suggestions worked very well.

Deborah

On Mar 25, 12:26 pm, dgard...@twcny.rr.com wrote:
This one has me stumped and I hope someone can help.

I have a form with a button on it. When I click the button, I want a
label named lblWait to be visible. (When the form opens, the label is
not visible.)

I have this line of code:
Me.lblWait.Visible = True

Then there is a line that defines strSQL. This takes a minute or so.
(There are over 250,000 records.)

Then I want the caption of the label to change.
me.lblWait.Caption = "New Caption"

Then the records are processed. This takes a very long time.

Here is my problem. The label does not become visible. I tried put
Me.Refresh right after Me.lblWait.Visible = True. I also tried a ms
delay.

Any suggestions?

Thank you,
Deborah

Mar 26 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Xerxes | last post by:
Hi, can you tell me how I can make a <label> hidden? I have hidden the field after the label: var M_Hide = isNS4?'hide':'hidden'; var M_Show =...
5
by: dcstech | last post by:
I have a label that will not display. On the form load event I wrote "label1.visible=false". when my routine get at the end of the code I inserted...
7
by: Jared | last post by:
Here is my situation. I have multiple labels on a form but only certain ones will become visible while using the form. Depending on which check...
2
by: Xarky | last post by:
Hi, I am trying to create a Label for a Windows Form, with my own code. Its not being visible. The code being used is the following. Label x =...
2
by: John Holmes | last post by:
I would like to turn on a label control in javascript with the onfocus event of another control by setting the Visible property to true. When I try...
31
by: jcrouse | last post by:
Is there a quick and easy way to change the color of a label controls border from the default black to white? Thank you, John
3
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for...
2
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I have a Label on a Windows form (Version 1.1.4322) and while I iterate recursively through a method I want to show the name of the current...
9
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a MDI Container Form, with one label control on the Background of this container form. When I now open a child form, this form is...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.