Setting properties of controls

BryanT

Registered User.
Local time
Tomorrow, 06:40
Joined
Mar 8, 2005
Messages
25
In the code for a report I am setting the .Left property of a Label according to where I want it to display on the report. This is determined by the current record being written. For most records this works fine but I have 1 record for which the correct position is passed to the .left property but this is ignored and the label is placed in a different location.


With Me.lblGrowforControl
' the correct value is given here but the .Left property ignores it
.Left = Me.txtMaxMonths.Left + (intStartMonthDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With
 
Original code
With Me.lblGrowforControl
' the correct value is given here but the .Left property ignores it
.Left = Me.txtMaxMonths.Left + (intStartMonthDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With

When I change the order of the .Left and .width lines the original record that caused trouble was fine but one other record played up.
When I alter the code to have identical .width lines both before and after the .left line everything seems to work fine.

With Me.lblGrowforControl
.Width = intDayDiff * sngFactor
.Left = Me.txtMaxMonths.Left + (intStartMonthDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With
 

Users who are viewing this thread

Back
Top Bottom