G
Guest
==You all helped me tremendously last week... please do it again!===
I have as many as nine groups of items from which to select one of up to
nine items. The groups are coded by tens (e.g., 10, 20, 30, etc.) and the
items are in the decade of their group (e.g., Item 11 belongs to Group 10).
A group may not have nine items, and, for matricing purposes, are not densely
numbered (e.g., Items 14 and 18 are missing from Group 10).
I have a dialog form whose sole control (an option group) is dynamically
populated based on the group identified by the calling form. The form only
allows form view, additions, and data entry; it is a pop-up, is modal, and
has the dialog border style. The option group is visible, enabled, and not
locked. The option buttons are named opt1, opt2, etc., and the corresponding
labels are named lblOption1, lblOption2, etc.
I want to disable option buttons that do not have corresponding items. The
option button labels are successfully populated by the attached Form_Open
event procedure, but the buttons themselves cannot be selected. What am I
doing wrong?
With Me
.Caption = strGroupType & " Type"
.lbl_grpDetailType.Caption = strGroupType
For i = 1 To 9
strDetailType = CStr(OpenArgs * 10 + i)
str_opt = "opt" & CStr(i)
str_lbl = "lblOption" & CStr(i)
rstDetailType.Seek "=", strDetailType
If rstDetailType.NoMatch Then
.Controls(str_opt).Enabled = False
.Controls(str_lbl).Visible = False
Else
.Controls(str_opt).Enabled = True
With .Controls(str_lbl)
.Visible = True
.Caption = fldDetailType
End With
End If
Next
End With
I'm also a kick-it-'til-it-works developer, so if an easier or more
efficient approach exists, please share it!
You all are the best!
I have as many as nine groups of items from which to select one of up to
nine items. The groups are coded by tens (e.g., 10, 20, 30, etc.) and the
items are in the decade of their group (e.g., Item 11 belongs to Group 10).
A group may not have nine items, and, for matricing purposes, are not densely
numbered (e.g., Items 14 and 18 are missing from Group 10).
I have a dialog form whose sole control (an option group) is dynamically
populated based on the group identified by the calling form. The form only
allows form view, additions, and data entry; it is a pop-up, is modal, and
has the dialog border style. The option group is visible, enabled, and not
locked. The option buttons are named opt1, opt2, etc., and the corresponding
labels are named lblOption1, lblOption2, etc.
I want to disable option buttons that do not have corresponding items. The
option button labels are successfully populated by the attached Form_Open
event procedure, but the buttons themselves cannot be selected. What am I
doing wrong?
With Me
.Caption = strGroupType & " Type"
.lbl_grpDetailType.Caption = strGroupType
For i = 1 To 9
strDetailType = CStr(OpenArgs * 10 + i)
str_opt = "opt" & CStr(i)
str_lbl = "lblOption" & CStr(i)
rstDetailType.Seek "=", strDetailType
If rstDetailType.NoMatch Then
.Controls(str_opt).Enabled = False
.Controls(str_lbl).Visible = False
Else
.Controls(str_opt).Enabled = True
With .Controls(str_lbl)
.Visible = True
.Caption = fldDetailType
End With
End If
Next
End With
I'm also a kick-it-'til-it-works developer, so if an easier or more
efficient approach exists, please share it!
You all are the best!