Re: label control won't update
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Fri, 27 May 2005 22:56:18 -0500
Chris wrote:
>I have a main form with a tab strip control containing 3 tabbed pages.
>Each tabbed page contains a subform. Each tabbed page contains label controls.
>
>In the footer section of each subform are text box controls with sum
>functions used to sum the values in particular rows of the data sheet.
>
>In the change event of the tabcontrol which is on the main form I have code
>like this:
>
>With Me.SubFormChild1.Form.RecordsetClone
> If .RecordCount > 0 Then
> Me.lblamount.Caption =
>Format(Me.SubFormChild1.Form.txtamounttotal.Value, "#,##.00")
> End If
>End With
>
>the recordsetclone is used to determine if there are records because if
>there are
>none and I try to put the totaled value into the caption property it will
>error.
>
>This works fine when I step through the code in debug mode.
>If I turn off the break point and let it run without stopping the labels do
>not
>get populated they are empty and my default value of 0 (zero) is wiped out.
>
>Now when I exist the debugged code I have to goto the window drop down in
>Access and choose my main form again to get it to be seen. This likely fires
>some sort of event that refreshes the form or something and lets the values
>display.
Try using the Repaint method at the end of your procedure.
If that's insufficient, then try adding a DoEvents statement
before you retrieve the value from the sum control.
If neither or both of those don't work, then the timing
issue (code runs before the Sum is calculated) is too severe
and you won't be able to use code to get this effect. Try
changing the label to a text box that refers to the Sum text
box.
--
Marsh
MVP [MS Access]
.
- Follow-Ups:
- Re: label control won't update
- From: Chris
- Re: label control won't update
- References:
- label control won't update
- From: Chris
- label control won't update
- Prev by Date: Re: Combo Box Default Value
- Next by Date: maximizing question
- Previous by thread: label control won't update
- Next by thread: Re: label control won't update
- Index(es):
Relevant Pages
|