 |
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1616
|
A useful tip for controls
Not sure if anyone knows this, or wants to know, but it's somewhat useful (there's been some discussions of how to access a form/control by it's name...):
' This is used in a program where the CtlName is a common
' String in a label and comboboxes
Private Sub EnableOption(ByVal CtlName As String, Optional ByVal fEnabled As Boolean = True)
Dim ctl As Control
Set ctl = Me.Controls("cbo" & CtlName & "From")
ctl.Enabled = fEnabled
Set ctl = Me.Controls("cbo" & CtlName & "To")
ctl.Enabled = fEnabled
Set ctl = Me.Controls("lbl" & CtlName & "Hours")
ctl.Enabled = fEnabled
Set ctl = Me.Controls("lbl" & CtlName & "To")
ctl.Enabled = fEnabled
Set ctl = Nothing
End Sub
|
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
04-07-2003 at 11:00 PM |
|
|
|
|
 |
 |