I have code built into a form in Access and everytime I try to open the form it gives me a Compile error: Expected array message and then highlights the word Left. I did not create this program and know very little about VBA but have been given the responsibility to take over this program. Please help I'm desperate!
Code:
Private Sub Form_Open(Cancel As Integer) 'Added
'unlock fields for STL
If TempVars![tvIsSTL] And Status <> "Closed" And Status <> "Historical" Then
Dim c As control
For Each c In Me.Controls
If Left(c.Name, 3) = "STL" Then
Select Case c.ControlType
Case Is = acTextBox
c.Locked = False
Case Is = acListBox
c.Locked = False
Case Is = acComboBox
c.Locked = False
Case Is = acCheckBox
c.Locked = False
Case Is = acCommandButton
c.Enabled = True
End Select
If Left(c.Name, 4) = "STLO" Then c.Visible = True
If InStr(1, UCase(c.Name), "CLOSEPROJECT") > 0 Then c.Visible = True
End If
Next
End If
Comment