Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabled all textboxt or listbox in a form

Status
Not open for further replies.

qazz

Programmer
Oct 6, 2002
13
PH
Greeting!

How can i make all textbox or listbox in a form enabled = false or true.

Thanks
 
Hi qazz,

This code placed in the On Click event of a Button will enable/disable text and list boxes:

On Error Resume Next
Dim ctl As Control
For Each ctl In Me.Controls
With ctl
Select Case .ControlType
Case acTextBox, acListBox
If .Enabled = True Then
.Enabled = False
Else
.Enabled = True
End If
End Select
End With
Next ctl

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top