469,360 Members | 1,749 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

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 10675

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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Xerxes | last post: by
5 posts views Thread by dcstech | last post: by
2 posts views Thread by Xarky | last post: by
2 posts views Thread by John Holmes | last post: by
31 posts views Thread by jcrouse | last post: by
3 posts views Thread by Neil Wallace | last post: by
2 posts views Thread by =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post: by
9 posts views Thread by =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.