Field display on report

pgp

Registered User.
Local time
Today, 22:31
Joined
Jul 1, 2003
Messages
33
Hi all,

Can I alter the different fields that I want to be displayed on the report depending on a particular field?

Like-
Say I have 2 records(1 & 2) and 4 fields - A,B,C & D (columns)
Record 1 has field A as green and record 2 has field a as red

if field A is green, I want to display only Field B and Field C for record 1

If field A is red, I want to display Field B, Field C, Field D and Field E for record 2

IS this possible?
Thanks in advance
 
Use an function in the detail format event as follows, expanding this theory will allow you to hide/show for each variation.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.KeyID > 1 Then
Me.KeyID.Visible = False
Else
Me.KeyID.Visible = True
End If
End Sub
 
Method/datamember not found

Hi Ian,

Thanks for your response. But unfortunately, it does not take .visible property .

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Description = "CRATE" Then
Me.ItemNumber.Visible = False
Me.Cert1.Visible = False
Me.Cert2.Visible = False
Me.Cert3.Visible = False
Me.PartSize.Visible = False
Me.OV.Visible = False
Me.OVPercent.Visible = False
End If
End Sub

Im trying to implement the above, but it says method/data member not found.

Actually I pull a subreport on a main report which display a list of line items for a given quote number. As you had mentioned, I tried writing this code in detail_event of my subreport. But it does not work!

Thanks again for all your help
 
Funny that, worked on my main report and when I inserted the same into a subreport. Try:

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

Dim blnVisible as Boolean

If Me.Description = "CRATE" Then
blnVisible = False
Else
blnVisible = True
End if

Me.ItemNumber.Visible = blnVisible
Me.Cert1.Visible = blnVisible
Me.Cert2.Visible = blnVisible
Me.Cert3.Visible = blnVisible
Me.PartSize.Visible = blnVisible
Me.OV.Visible = blnVisible
Me.OVPercent.Visible = blnVisible

End If
End Sub

If that doesn't work, please come back and I'll try and recreate unles
 
Hi Ian,

I think its the .Visible property - not the value that we assign.

When I do Me.Cert1. ( It shud pull up all the valid properties that goes along with this) , in my case, it pulls up just "value"alone.

Am I doing something wrong here?
 

When I do Me.Cert1. ( It shud pull up all the valid properties that goes along with this) , in my case, it pulls up just "value"alone.


So does mine, I just type 'Visible' and it is accepted.

Look at the attached sample report 'THIS_ONE' in the attached.
 

Attachments

There are several methods in reports vba that do not display with intellisense, .Visible is one of them
 

Users who are viewing this thread

Back
Top Bottom