Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Form label not updating immediately

I have a simple form with 2 command buttons and several labels.

CommandButton2 simply closes the file (Cancel).
This works OK.

CommandButton1 calls some code in a worksheet within the same workbook. This
code is intended to work in the background with the form still visible in
front. This part works.
This works OK.

Label7 is not visible initially and I want it to become visible as soon as
CommandButton1 is clicked. The label does not appear for several seconds
after clicking the button. I added the timer to try to give the label time
to be displayed before moving on, but much of the called code has processed
before the label appears.

As the label simply asks the user to wait while the code runs, this isn't a
lot of use.

Any ideas?

--
Ian
--


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Form label not updating immediately

CommandButton1_Click()
me.Label7.visible = true
me.Label7.Caption = "Processing..."
'Call your procedure here
End Sub


The first two lines of the procedure should make the label visible and
update the caption property. Doing this before calling any other code should
resolve the isseue.
However, ditching the label all together and updating the userforms caption
property could also be an option.


"IanC" wrote:

I have a simple form with 2 command buttons and several labels.

CommandButton2 simply closes the file (Cancel).
This works OK.

CommandButton1 calls some code in a worksheet within the same workbook. This
code is intended to work in the background with the form still visible in
front. This part works.
This works OK.

Label7 is not visible initially and I want it to become visible as soon as
CommandButton1 is clicked. The label does not appear for several seconds
after clicking the button. I added the timer to try to give the label time
to be displayed before moving on, but much of the called code has processed
before the label appears.

As the label simply asks the user to wait while the code runs, this isn't a
lot of use.

Any ideas?

--
Ian
--



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Form label not updating immediately

Hi Jeff

It's not made any difference. I already had Label7.Visible = True. I've
changed this to Me.Label7.Visible = True and added the caption line but it
doesn't help.

If I extend the time delay, the delay before the label appears also
increases. In other words, the label always seems to appear at around the
same point in the called code exectution.
I tried adding a break point at various points in the code, but the only
thing I could determine from that is that the label appears as soon as the
breakpoint is reached, wherever I put it!

My code is below.

Private Sub CommandButton1_Click()
Dim x
' "Start updates" button

Me.Label7.Visible = True
Me.Label7.Caption = "Updating..."

x = Now()
While Now() < x + TimeValue("0:00:02")
Wend

Call Worksheets("Update list").update
End Sub

"Jeff" wrote in message
...
CommandButton1_Click()
me.Label7.visible = true
me.Label7.Caption = "Processing..."
'Call your procedure here
End Sub


The first two lines of the procedure should make the label visible and
update the caption property. Doing this before calling any other code
should
resolve the isseue.
However, ditching the label all together and updating the userforms
caption
property could also be an option.


"IanC" wrote:

I have a simple form with 2 command buttons and several labels.

CommandButton2 simply closes the file (Cancel).
This works OK.

CommandButton1 calls some code in a worksheet within the same workbook.
This
code is intended to work in the background with the form still visible in
front. This part works.
This works OK.

Label7 is not visible initially and I want it to become visible as soon
as
CommandButton1 is clicked. The label does not appear for several seconds
after clicking the button. I added the timer to try to give the label
time
to be displayed before moving on, but much of the called code has
processed
before the label appears.

As the label simply asks the user to wait while the code runs, this isn't
a
lot of use.

Any ideas?

--
Ian
--





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate to form a label gwendalee Excel Discussion (Misc queries) 3 October 16th 07 12:59 AM
Hyperlink on a label in a VB Form Gaetan Excel Discussion (Misc queries) 4 May 28th 07 12:35 PM
Form label not showing Les Stout[_2_] Excel Programming 0 October 17th 06 11:00 AM
COPY LABEL FORM FROM EXCEL TO A LABEL xrayAndi New Users to Excel 1 March 5th 06 02:21 PM
Disable Label in a Form Stuart[_21_] Excel Programming 4 March 13th 05 11:04 PM


All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"