E
Eddy
In Access2003 I am trying to store the Top property value for each control
in an array, move to another sub procedure behind the report that
manipulates the controls then reset the Top property values to the controls
that I stored in the array. I am using the following code:
At the module level I declare the array:
Private varVal() As Variant
To store the values in the array I use this code:
Private Sub Set()
Dim intX as Integer
ReDim varValHdr1(intX + 32)
For Each ctl In Me.GroupHeader3.Controls
varValHdr1(intX) = ctl.Top
intX = intX + 1
Next ctl
To restore the original Top values I use this code:
Private Sub Restore()
Dim intX As Integer
ReDim Preserve varValHdr1(intX + 32)
For Each ctl In Me.GroupHeader3.Controls
ctl.Top = varValHdr1(intX)
intX = intX + 1
Next ctl
The code goes through the first Private Sub Set fine. When it runs the sub
Restore it loads 3 values back then gives me the error; "The Control or Sub
form control is to large for this location". I notice when I stop the code
and in the Immediate Window when I query ?ctl.Top it returns a value of 630
yet when I am in the report in design mode the Top value for the same
control is .4332
Sorry for such a elaborate question. I'm new to this and couldn't figure out
a shorter way.
Thanks again.
in an array, move to another sub procedure behind the report that
manipulates the controls then reset the Top property values to the controls
that I stored in the array. I am using the following code:
At the module level I declare the array:
Private varVal() As Variant
To store the values in the array I use this code:
Private Sub Set()
Dim intX as Integer
ReDim varValHdr1(intX + 32)
For Each ctl In Me.GroupHeader3.Controls
varValHdr1(intX) = ctl.Top
intX = intX + 1
Next ctl
To restore the original Top values I use this code:
Private Sub Restore()
Dim intX As Integer
ReDim Preserve varValHdr1(intX + 32)
For Each ctl In Me.GroupHeader3.Controls
ctl.Top = varValHdr1(intX)
intX = intX + 1
Next ctl
The code goes through the first Private Sub Set fine. When it runs the sub
Restore it loads 3 values back then gives me the error; "The Control or Sub
form control is to large for this location". I notice when I stop the code
and in the Immediate Window when I query ?ctl.Top it returns a value of 630
yet when I am in the report in design mode the Top value for the same
control is .4332
Sorry for such a elaborate question. I'm new to this and couldn't figure out
a shorter way.
Thanks again.