Connecting Tech Pros Worldwide Forums | Help | Site Map

label is not visible on form

dgardner@twcny.rr.com
Guest
 
Posts: n/a
#1: Mar 25 '07
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


storrboy
Guest
 
Posts: n/a
#2: Mar 25 '07

re: label is not visible on form



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

Don Leverton
Guest
 
Posts: n/a
#3: Mar 25 '07

re: label is not visible on form


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

<dgardner@twcny.rr.comwrote in message
news:1174839992.198275.42280@o5g2000hsb.googlegrou ps.com...
Quote:
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
>

salad
Guest
 
Posts: n/a
#4: Mar 25 '07

re: label is not visible on form


dgardner@twcny.rr.com wrote:
Quote:
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.


Larry Linson
Guest
 
Posts: n/a
#5: Mar 25 '07

re: label is not visible on form


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

<dgardner@twcny.rr.comwrote in message
news:1174839992.198275.42280@o5g2000hsb.googlegrou ps.com...
Quote:
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
>

dgardner@twcny.rr.com
Guest
 
Posts: n/a
#6: Mar 26 '07

re: label is not visible on form


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:
Quote:
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

Closed Thread