I have a report that has a lot of different controls on it and only some need to be seen for certain customers.
I am trying to Move one control based on the position of the one next to it
Below is my code, but when the debugger pops up it highlights: Me.CustSKU.Left = Me.CXL.Right + 25
Expand|Select|Wrap|Line Numbers
- Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
- Dim lngCustID As Long
- lngCustID = Forms![AllCust]![Customer]
- Select Case lngCustID
- Case 'Customer ID
- Me.CustSKU.Visible = True
- Me.CustSKU_Label.Visible = True
- Me.CustSKU_Label.Left = Me.CustSKU.Left
- Me.CustSKU_Label.Width = Me.CustSKU.Width
- ...
- Me.CustSKU.Left = Me.CXL.Right + 25
- Me.Field1.Left = Me.CustSKU.Right + 75
- Me.Field2.Left = Me.Field1.Right + 75
- Me.Field3.Left = Me.Field2.Right + 75
- Me.Field4.Left = Me.Field3.Right + 75
- Me.Field5.Left = Me.Field4.Right + 75
- ...
- End Select
- End Sub