Report Group Visibility

J

Jason Rhymes

Trying to control a group visibility state in a report through a form and
it's not happening.
Any tips?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If [Forms]![JobList]![Show_Detail] = 0 Then
Me.Detail.Visible = True
Else
Me.Detail.Visible = False

End If
End Sub
 
J

June7 via AccessMonster.com

Try referencing the textbox instead of the recordset field: Form_JobList.
Show_Detail

Suggestion: use prefixes with control names so you know what is being
referenced in code, ex:
tbxShowDetail, cbxShowDetail, lbxShowDetail

Jason said:
Trying to control a group visibility state in a report through a form and
it's not happening.
Any tips?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If [Forms]![JobList]![Show_Detail] = 0 Then
Me.Detail.Visible = True
Else
Me.Detail.Visible = False

End If
End Sub
 
A

AccessVandal via AccessMonster.com

First of all, how would it work having the detail section invisible. The code
couldn't run if the detail is hidden.

Try to use the code in the OnOpen event of your Report.

Jason said:
Trying to control a group visibility state in a report through a form and
it's not happening.
Any tips?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If [Forms]![JobList]![Show_Detail] = 0 Then
Me.Detail.Visible = True
Else
Me.Detail.Visible = False

End If
End Sub
 
J

Jason Rhymes

Sorry, I posted in the wrong group. It is actually in a report were I'm
trying to do this. I've reposted in the reports ng.
Thanks
 
Top