With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!
and this in a private sub:
Private Sub Form_Current() DisableControls End Sub
Private Sub DisableControls() On Error GoTo Err_DisableControls If DLookup("[SecurityLevel]", "LOCALtblCurrentUser") > 2 Then Dim ctl As Control For Each ctl In Me.Controls Select Case ctl.ControlType Case acComboBox If ctl.Name <> "cboFindRecord" Or ctl.Name <> "cboPartN" Then ctl.Locked = True Case acCommandButton If ctl.Name <> "cmdMainMenu" Or ctl.Name <> "cmdGridView" Then ctl.Locked = True Case acTextBox If ctl.Name <> "txtCompanyID" Then ctl.Locked = True End Select Next End If Exit_DisableControls: Exit Sub Err_DisableControls: MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Description: " & Err.Description & vbCrLf & "Error Source: " & Err.Source Resume Exit_DisableControls End Sub But when the form opens I get an error... Error #438. Object doesn't support this property or method.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.