Good morning,
I have a continuous form I would like the end user to have the option to adjust the column width based on need. I did some looking around the internet and found the following from Lauren Quantrell:
On a continuous form, in the Form Header section, between two heading
labels, create a box with the height equalling the header height and
the width = 0.1576". Name this box BoxColumn1.
Create two text boxes named LeftColumName and RightColumName
Rename the labels for these text boxes to LeftColumLabel and
RightColumLabel
Add this code to the OnMouseMove event of BoxColumn1:
Code:
'START CODE
************************************************** ***************************************
Private Sub BoxColumn1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim intLeftButton As Integer
Dim ColumOneAdjust As Integer
Dim ColumTwoAdjust As Integer
intLeftButton = Button And acLeftButton
ColumOneAdjust = 60
ColumTwoAdjust = 800
' as you move over the box, the pointer will change to the left-right
Size arrows:
Screen.MousePointer = 9
' only if you click the left mouse button will you're over BoxColumn1 will it size, otherwise just pass over the box:
If intLeftButton 0 Then 'Here is where I am getting the error
'now calculate all the sizes:
If (Me.BoxColumn1.Left + X) - ColumOneAdjust > Me.LeftColumName.Left + ColumTwoAdjust And Me.BoxColumn1.Left + X < Me.ContactsType.Left - 1200 Then
Me.BoxColumn1.Left = Me.BoxColumn1.Left + X
Me.BoxColumn1Row.Left = Me.BoxColumn1.Left
Me.LeftColumName.Width = (Me.BoxColumn1.Left - Me.LeftColumName.Left) - 100
Me.LeftColumLabel.Width = Me.LeftColumName.Width
Me.RightColumName.Width = Me.ContactsType.Left - (Me.RightColumName.Left + 60)
Me.RightColumName.Left = Me.BoxColumn1.Left + 60
Me.RightColumLabel.Left = Me.RightColumName.Left
Me.RightColumLabel.Width = Me.RightColumName.Width
End If
End If
End Sub
I am getting an error on the line
If intLeftButton 0 Then. I understand why and it is an integer and there is no criteria. Ideas?