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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show levels of detail on report

Status
Not open for further replies.

Jamie2002

Technical User
Sep 17, 2001
62
GB
Easy one this but not for me.

Can anyone tell me the code for a button on a form that when pressed opens a report ... next to the button is an option goup for detail level (High, Medium, Low), depending on what is selected different headers & footers are shown on the same report....

My problem being I don't know the code that says if option group = 1 then hide/show header footer

Please help

Thanks
 
This may not be the best way to do this, but Here goes:

Make 3 booleans in a Public Module (We'll call them GroupLVL1, GroupLVL2, GroupLVL3).

On your form, when you select the drop down box containing what you need, on the AFTERUPDATE coding, have it do the following (We'll say the box is DropBox)

If DropBox = "Value" then
GroupLVL1 = True
GroupLVL2 = False
GroupLVL3 = False
ElseIf DropBox = "Value2" then
GroupLVL1 = False
GroupLVL2 = True
GroupLVL3 = False
ElseIf DropBox = "Value3" then
GroupLVL1 = False
GroupLVL2 = False
GroupLVL3 = True
end if

On the report you will have your 3 boxes (We'll Call them Box1, Box2, Box3.) Make these Visible = NO.

On the report ONOPEN even, place the code

If GroupLVL1 = True then
box1.visible = True
ElseIf GroupLVL2 = true then
box2.visible = True
elseif GroupLVL3 = true then
box3.visible = true
end if

Make sure to place the code:

GroupLVL1 = False
GroupLVL2 = False
GroupLVL3 = False

in the report ONCLOSE event to make sure that those boxes will only show when you select a level from the drop box. If you use checkboxes instead just place the GroupLVL# stuff in the ONCLICK event. It should work just fine (or at least this is what i've done for multiple detail for my reports).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top