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