Connecting Tech Pros Worldwide Help | Site Map

label is not visible on form

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 25th, 2007, 04:35 PM
dgardner@twcny.rr.com
Guest
 
Posts: n/a
Default 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


  #2  
Old March 25th, 2007, 04:45 PM
storrboy
Guest
 
Posts: n/a
Default 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

  #3  
Old March 25th, 2007, 05:15 PM
Don Leverton
Guest
 
Posts: n/a
Default 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
>

  #4  
Old March 25th, 2007, 07:05 PM
salad
Guest
 
Posts: n/a
Default 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.


  #5  
Old March 25th, 2007, 07:45 PM
Larry Linson
Guest
 
Posts: n/a
Default 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
>

  #6  
Old March 26th, 2007, 01:05 AM
dgardner@twcny.rr.com
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.