KAyers
Registered User.
- Local time
- Today, 17:48
- Joined
- Oct 30, 2007
- Messages
- 23
I have created a form with checkboxes controlling the enabling of certain groups of fields. Now that I am constructing the report, I have a subreport which should display a field from group 1 if checkbox 1=true if not it should show a field from group 3. I looked for something similar in the threads but my search words may be incorrect- sorry if this is a dup. My question is- should I use similar coding to the form's enable/disable for the report? I am not as familiar with reports so I don't know if this is the best way to go and I'm not sure how to tie this into the report without event handlers for the text field- perhaps I should be using the onFormat for the report detail- I'm not sure and I'm hitting a wall here!
Thanks for any help!
K
'Group Disable/Enable settings
Private Sub fDisableGrp(strGroup As String)
Dim Ctl As Control
For Each Ctl In Me.Controls
Select Case Ctl.ControlType
Case acTextBox, acComboBox, acOptionGroup, acListBox, acCommandButton
If fGetGroup(Ctl.Name, strGroup) Then Ctl.Enabled = False
End Select
Next Ctl
End Sub
Private Sub fEnableGrp(strGroup As String)
Dim Ctl As Control
For Each Ctl In Me.Controls
Select Case Ctl.ControlType
Case acTextBox, acComboBox, acOptionGroup, acListBox, acCommandButton
If fGetGroup(Ctl.Name, strGroup) Then Ctl.Enabled = True
End Select
Next Ctl
End Sub
'Unit 1 (Group 1 "G1") Disable/Enable by checkbox
Private Sub U1_AfterUpdate()
Call U1_Group
End Sub
Private Sub U1_Group()
If Nz(Me.U1) Then
Call fEnableGrp("G1")
Else
Call fDisableGrp("G1")
End If
End Sub
Thanks for any help!
K
'Group Disable/Enable settings
Private Sub fDisableGrp(strGroup As String)
Dim Ctl As Control
For Each Ctl In Me.Controls
Select Case Ctl.ControlType
Case acTextBox, acComboBox, acOptionGroup, acListBox, acCommandButton
If fGetGroup(Ctl.Name, strGroup) Then Ctl.Enabled = False
End Select
Next Ctl
End Sub
Private Sub fEnableGrp(strGroup As String)
Dim Ctl As Control
For Each Ctl In Me.Controls
Select Case Ctl.ControlType
Case acTextBox, acComboBox, acOptionGroup, acListBox, acCommandButton
If fGetGroup(Ctl.Name, strGroup) Then Ctl.Enabled = True
End Select
Next Ctl
End Sub
'Unit 1 (Group 1 "G1") Disable/Enable by checkbox
Private Sub U1_AfterUpdate()
Call U1_Group
End Sub
Private Sub U1_Group()
If Nz(Me.U1) Then
Call fEnableGrp("G1")
Else
Call fDisableGrp("G1")
End If
End Sub
Last edited: