PC Review


Reply
Thread Tools Rate Thread

Conditional Show/Hide Records

 
 
=?Utf-8?B?R3dlbiBI?=
Guest
Posts: n/a
 
      4th May 2006
I have a report that lists loan officers and their loan sales for the
previous month. Some loan officers supervise others, and therefore the report
is grouped on the Supervisor field.

In the detail section, how do I hide an entire record if the loan officer's
name is the same as the supervisor's name? Here is the code I tried to use in
the detail section, but it only hides the field containing the loan
officer's name; I need to hide the entire record. BUT, I still need the data
to be in the report so that the loan sales numbers can be used on
calculations on the report.

If Loan_Officer = Supervisor Then
Me.Loan_Officer.Visible = False
Else
Me.Loan_Officer.Visible = True
End If

Any help would be greatly appreciated!

GwenH
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2ZlciBDb2hlbg==?=
Guest
Posts: n/a
 
      4th May 2006
Instead of writing extra code, you can a filer to your report Record Source,
such as

Select * From TableName Where Loan_Officer <> Supervisor
====================================

To follw your idea, which I don't recomand, yu need to specify for each
field in the detail section

Me.Loan_Officer.Visible = (Loan_Officer <> Supervisor)
Me.Supervisor.Visible = (Loan_Officer <> Supervisor)
Me.FieldName.Visible = (Loan_Officer <> Supervisor)
Me.FieldName2.Visible = (Loan_Officer <> Supervisor)
Me.FieldName3.Visible = (Loan_Officer <> Supervisor)

etc
--
Good Luck
BS"D


"Gwen H" wrote:

> I have a report that lists loan officers and their loan sales for the
> previous month. Some loan officers supervise others, and therefore the report
> is grouped on the Supervisor field.
>
> In the detail section, how do I hide an entire record if the loan officer's
> name is the same as the supervisor's name? Here is the code I tried to use in
> the detail section, but it only hides the field containing the loan
> officer's name; I need to hide the entire record. BUT, I still need the data
> to be in the report so that the loan sales numbers can be used on
> calculations on the report.
>
> If Loan_Officer = Supervisor Then
> Me.Loan_Officer.Visible = False
> Else
> Me.Loan_Officer.Visible = True
> End If
>
> Any help would be greatly appreciated!
>
> GwenH

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      5th May 2006
I seem to recall that you can set the entire section to visible.not visible in
the format event of the section

me.Section(acDetail).Visible = ([Loan_Officer] <> [Supervisor])

Test that, I wrote it off the top of my head and the constant acDetail may be
incorrect. Can't check that on this computer.


Ofer Cohen wrote:
>
> Instead of writing extra code, you can a filer to your report Record Source,
> such as
>
> Select * From TableName Where Loan_Officer <> Supervisor
> ====================================
>
> To follw your idea, which I don't recomand, yu need to specify for each
> field in the detail section
>
> Me.Loan_Officer.Visible = (Loan_Officer <> Supervisor)
> Me.Supervisor.Visible = (Loan_Officer <> Supervisor)
> Me.FieldName.Visible = (Loan_Officer <> Supervisor)
> Me.FieldName2.Visible = (Loan_Officer <> Supervisor)
> Me.FieldName3.Visible = (Loan_Officer <> Supervisor)
>
> etc
> --
> Good Luck
> BS"D
>
> "Gwen H" wrote:
>
> > I have a report that lists loan officers and their loan sales for the
> > previous month. Some loan officers supervise others, and therefore the report
> > is grouped on the Supervisor field.
> >
> > In the detail section, how do I hide an entire record if the loan officer's
> > name is the same as the supervisor's name? Here is the code I tried to use in
> > the detail section, but it only hides the field containing the loan
> > officer's name; I need to hide the entire record. BUT, I still need the data
> > to be in the report so that the loan sales numbers can be used on
> > calculations on the report.
> >
> > If Loan_Officer = Supervisor Then
> > Me.Loan_Officer.Visible = False
> > Else
> > Me.Loan_Officer.Visible = True
> > End If
> >
> > Any help would be greatly appreciated!
> >
> > GwenH

 
Reply With Quote
 
=?Utf-8?B?T2ZlciBDb2hlbg==?=
Guest
Posts: n/a
 
      5th May 2006
Excelent, never stop to learn new things
Thanks John


"John Spencer" wrote:

> I seem to recall that you can set the entire section to visible.not visible in
> the format event of the section
>
> me.Section(acDetail).Visible = ([Loan_Officer] <> [Supervisor])
>
> Test that, I wrote it off the top of my head and the constant acDetail may be
> incorrect. Can't check that on this computer.
>
>
> Ofer Cohen wrote:
> >
> > Instead of writing extra code, you can a filer to your report Record Source,
> > such as
> >
> > Select * From TableName Where Loan_Officer <> Supervisor
> > ====================================
> >
> > To follw your idea, which I don't recomand, yu need to specify for each
> > field in the detail section
> >
> > Me.Loan_Officer.Visible = (Loan_Officer <> Supervisor)
> > Me.Supervisor.Visible = (Loan_Officer <> Supervisor)
> > Me.FieldName.Visible = (Loan_Officer <> Supervisor)
> > Me.FieldName2.Visible = (Loan_Officer <> Supervisor)
> > Me.FieldName3.Visible = (Loan_Officer <> Supervisor)
> >
> > etc
> > --
> > Good Luck
> > BS"D
> >
> > "Gwen H" wrote:
> >
> > > I have a report that lists loan officers and their loan sales for the
> > > previous month. Some loan officers supervise others, and therefore the report
> > > is grouped on the Supervisor field.
> > >
> > > In the detail section, how do I hide an entire record if the loan officer's
> > > name is the same as the supervisor's name? Here is the code I tried to use in
> > > the detail section, but it only hides the field containing the loan
> > > officer's name; I need to hide the entire record. BUT, I still need the data
> > > to be in the report so that the loan sales numbers can be used on
> > > calculations on the report.
> > >
> > > If Loan_Officer = Supervisor Then
> > > Me.Loan_Officer.Visible = False
> > > Else
> > > Me.Loan_Officer.Visible = True
> > > End If
> > >
> > > Any help would be greatly appreciated!
> > >
> > > GwenH

>

 
Reply With Quote
 
=?Utf-8?B?R3dlbiBI?=
Guest
Posts: n/a
 
      5th May 2006
I'm sorry, I didn't explain myself clearly enough. This is the structure of
my report:

Group Header: Alene (Supervisor) - No other fields on this line
-------------------------------------------------------------------------
Detail section:
John
Don
Alene
Alene Totals

What I want to do is hide Alene's first line in the detail section. I don't
want to hide the whole detail section, nor do I want to filter Alene's data
out because it is used in calculations on the report. I just want to hide her
line, without leaving a blank line in the detail section where her line would
have been (in other words, a white row all the way across the report, in the
middle of the detail section).

Thanks again,
GwenH



"Gwen H" wrote:

> I have a report that lists loan officers and their loan sales for the
> previous month. Some loan officers supervise others, and therefore the report
> is grouped on the Supervisor field.
>
> In the detail section, how do I hide an entire record if the loan officer's
> name is the same as the supervisor's name? Here is the code I tried to use in
> the detail section, but it only hides the field containing the loan
> officer's name; I need to hide the entire record. BUT, I still need the data
> to be in the report so that the loan sales numbers can be used on
> calculations on the report.
>
> If Loan_Officer = Supervisor Then
> Me.Loan_Officer.Visible = False
> Else
> Me.Loan_Officer.Visible = True
> End If
>
> Any help would be greatly appreciated!
>
> GwenH

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      5th May 2006
So, in the detail section's format event, try the code that was posted
earlier. Did that fail? If so, what was the error? Or how did it fail?

Me.Section(acDetail).Visible = ([Loan_Officer] <> [Supervisor])

That should show/hide individual detail lines.

"Gwen H" <(E-Mail Removed)> wrote in message
news:9E0C4563-AA0A-4FC6-9451-(E-Mail Removed)...
> I'm sorry, I didn't explain myself clearly enough. This is the structure
> of
> my report:
>
> Group Header: Alene (Supervisor) - No other fields on this line
> -------------------------------------------------------------------------
> Detail section:
> John
> Don
> Alene
> Alene Totals
>
> What I want to do is hide Alene's first line in the detail section. I
> don't
> want to hide the whole detail section, nor do I want to filter Alene's
> data
> out because it is used in calculations on the report. I just want to hide
> her
> line, without leaving a blank line in the detail section where her line
> would
> have been (in other words, a white row all the way across the report, in
> the
> middle of the detail section).
>
> Thanks again,
> GwenH
>
>
>
> "Gwen H" wrote:
>
>> I have a report that lists loan officers and their loan sales for the
>> previous month. Some loan officers supervise others, and therefore the
>> report
>> is grouped on the Supervisor field.
>>
>> In the detail section, how do I hide an entire record if the loan
>> officer's
>> name is the same as the supervisor's name? Here is the code I tried to
>> use in
>> the detail section, but it only hides the field containing the loan
>> officer's name; I need to hide the entire record. BUT, I still need the
>> data
>> to be in the report so that the loan sales numbers can be used on
>> calculations on the report.
>>
>> If Loan_Officer = Supervisor Then
>> Me.Loan_Officer.Visible = False
>> Else
>> Me.Loan_Officer.Visible = True
>> End If
>>
>> Any help would be greatly appreciated!
>>
>> GwenH



 
Reply With Quote
 
=?Utf-8?B?R3dlbiBI?=
Guest
Posts: n/a
 
      5th May 2006
Sorry, I thought you were telling me how to hide the entire section. The
solution you suggested worked; thank you.

"John Spencer" wrote:

> So, in the detail section's format event, try the code that was posted
> earlier. Did that fail? If so, what was the error? Or how did it fail?
>
> Me.Section(acDetail).Visible = ([Loan_Officer] <> [Supervisor])
>
> That should show/hide individual detail lines.
>
> "Gwen H" <(E-Mail Removed)> wrote in message
> news:9E0C4563-AA0A-4FC6-9451-(E-Mail Removed)...
> > I'm sorry, I didn't explain myself clearly enough. This is the structure
> > of
> > my report:
> >
> > Group Header: Alene (Supervisor) - No other fields on this line
> > -------------------------------------------------------------------------
> > Detail section:
> > John
> > Don
> > Alene
> > Alene Totals
> >
> > What I want to do is hide Alene's first line in the detail section. I
> > don't
> > want to hide the whole detail section, nor do I want to filter Alene's
> > data
> > out because it is used in calculations on the report. I just want to hide
> > her
> > line, without leaving a blank line in the detail section where her line
> > would
> > have been (in other words, a white row all the way across the report, in
> > the
> > middle of the detail section).
> >
> > Thanks again,
> > GwenH
> >
> >
> >
> > "Gwen H" wrote:
> >
> >> I have a report that lists loan officers and their loan sales for the
> >> previous month. Some loan officers supervise others, and therefore the
> >> report
> >> is grouped on the Supervisor field.
> >>
> >> In the detail section, how do I hide an entire record if the loan
> >> officer's
> >> name is the same as the supervisor's name? Here is the code I tried to
> >> use in
> >> the detail section, but it only hides the field containing the loan
> >> officer's name; I need to hide the entire record. BUT, I still need the
> >> data
> >> to be in the report so that the loan sales numbers can be used on
> >> calculations on the report.
> >>
> >> If Loan_Officer = Supervisor Then
> >> Me.Loan_Officer.Visible = False
> >> Else
> >> Me.Loan_Officer.Visible = True
> >> End If
> >>
> >> Any help would be greatly appreciated!
> >>
> >> GwenH

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide navigation buttons but show number of records =?Utf-8?B?QmVubnk=?= Microsoft Access 2 28th Mar 2007 02:19 AM
RowDataBound: testing for data elements for conditional show/hide Microsoft ASP .NET 3 27th Jul 2006 02:03 AM
Hide/show different records Beth Microsoft Access Form Coding 1 31st May 2006 06:32 PM
How to hide duplicate records but show them once =?Utf-8?B?TGlzYQ==?= Microsoft Excel Misc 7 1st Aug 2005 09:26 PM
show/hide control w conditional formatting David Microsoft Access Form Coding 1 30th Apr 2005 02:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 PM.