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

Hide object in report 2

Status
Not open for further replies.

PJFry

Technical User
Feb 6, 2005
93
US
I am working on a report where I want to show one of five custom symbols. The symbol that is shown depends on the status of a project. I have this functionality in a form and it reads like this

Code:
If lngStatus = 1 Then
Me.imgRed1t.Visible = True
else [i]all the other conditions[/i]
End If

How do I do the same thing when I am in a report?

Thanks!
PJ
 
You can use pretty much the same code in the Deatil Format event, but you must fill in both conditions:

[tt]If lngStatus = 1 Then
Me.imgRed1t.Visible = True
else
Me.imgRed1t.Visible = False
End If[/tt]
 
To add to Remou's statement, I would hide all five objects, then figure out which one should be shown...all during the Format event of the section in which the object shows...

Code:
Me.imgRedit.Visible = False
Me.object2.Visible = False
Me.object3.Visible = False
Me.object4.Visible = False
Me.object5.Visible = False

Select Case lngStatus
    Case 1: Me.imgRedit.Visible = True
    Case 2: Me.object2.visible = True
    Case 3: Me.object2.visible = True
    Case 4: Me.object2.visible = True
    Case 5: Me.object2.visible = True
End Select

Of course, this is all contingent on the fact that lngStatus is the field, and the only field, that determines the object to show.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Worked perfectly. Thanks to both!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top