Hide duplicate rows on continuous form

G

Guest

I know you can't hide duplicate rows of a continuous form while leaving other
visible. However, I think I can use conditional formatting. If I can, what
sort of expresssion would I put into the condition to check to see if the
previous record's field is identical?
 
D

Douglas J. Steele

I don't believe it's possible.

Why not eliminate the duplicates from the recordsource by using the DISTINCT
keyword in the query?
 
G

Guest

Each row is a record on the continuous form from a qry that combines Cust and
Site info. For each record, ib the left of the form is customer info. and on
the right is site info. Each Cust can have many sites. I don't want to repeat
the cust. info on the left for each site for that cust. on the right.
 
G

Guest

in other words, i only need to hide part of the row if the row is identical
as the row above vs. not showing the entire row which I could do by
eliminating dups in the record source
 
D

Douglas J. Steele

I'm not sure there is a way to accomplish that on a form. (It's trivial, of
course, to achieve it on a report.)
 
G

Guest

This is from another posting...would this work and if so, could you help me
modify code to my application...

I thought your question sounded too easy. So you want the Subject field to
be bold whenever the value of Subject is different than the previous Subject?
That is a bit trickier and requires some VB.

Add a Global Variable to any module (or create a new one) to keep the old
subject.

Global strPreviousSubject As String

Below that, add the function to check to see if the line should be bold:

Function fBoldField(Optional ByVal strSubject As String) As Boolean
fBoldField = False
If IsNull(strSubject) Then Exit Function
If strSubject <> strPreviousSubject Then fBoldField = True
strPreviousSubject = strSubject
End Function

Then, for the conditional formatting of your Subject box, choose Expression
Is with

fBoldField([User])

as the expression.

Whenever the fBoldField Function returns a true value, the conditional
formatting will kick in.
 
D

Douglas J. Steele

I'm not sure it would work. In essense, you're trying to delete a value, not
change how it appears. That's not what Conditional Formatting is intended
for.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dan said:
This is from another posting...would this work and if so, could you help
me
modify code to my application...

I thought your question sounded too easy. So you want the Subject field
to
be bold whenever the value of Subject is different than the previous
Subject?
That is a bit trickier and requires some VB.

Add a Global Variable to any module (or create a new one) to keep the old
subject.

Global strPreviousSubject As String

Below that, add the function to check to see if the line should be bold:

Function fBoldField(Optional ByVal strSubject As String) As Boolean
fBoldField = False
If IsNull(strSubject) Then Exit Function
If strSubject <> strPreviousSubject Then fBoldField = True
strPreviousSubject = strSubject
End Function

Then, for the conditional formatting of your Subject box, choose
Expression
Is with

fBoldField([User])

as the expression.

Whenever the fBoldField Function returns a true value, the conditional
formatting will kick in.



Douglas J. Steele said:
I'm not sure there is a way to accomplish that on a form. (It's trivial,
of
course, to achieve it on a report.)
 
G

Guest

I don't want to delete those values. Just make the text the same color as
background so they disapear. In other words, the row will still be visible,
but some fields on the left won't be visible if the CustNum is the same as
the CustNum on the row above. Sorry for the confusion and thanks for
continuing to help!

Douglas J. Steele said:
I'm not sure it would work. In essense, you're trying to delete a value, not
change how it appears. That's not what Conditional Formatting is intended
for.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dan said:
This is from another posting...would this work and if so, could you help
me
modify code to my application...

I thought your question sounded too easy. So you want the Subject field
to
be bold whenever the value of Subject is different than the previous
Subject?
That is a bit trickier and requires some VB.

Add a Global Variable to any module (or create a new one) to keep the old
subject.

Global strPreviousSubject As String

Below that, add the function to check to see if the line should be bold:

Function fBoldField(Optional ByVal strSubject As String) As Boolean
fBoldField = False
If IsNull(strSubject) Then Exit Function
If strSubject <> strPreviousSubject Then fBoldField = True
strPreviousSubject = strSubject
End Function

Then, for the conditional formatting of your Subject box, choose
Expression
Is with

fBoldField([User])

as the expression.

Whenever the fBoldField Function returns a true value, the conditional
formatting will kick in.



Douglas J. Steele said:
I'm not sure there is a way to accomplish that on a form. (It's trivial,
of
course, to achieve it on a report.)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


in other words, i only need to hide part of the row if the row is
identical
as the row above vs. not showing the entire row which I could do by
eliminating dups in the record source

:

I don't believe it's possible.

Why not eliminate the duplicates from the recordsource by using the
DISTINCT
keyword in the query?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I know you can't hide duplicate rows of a continuous form while
leaving
other
visible. However, I think I can use conditional formatting. If I
can,
what
sort of expresssion would I put into the condition to check to see
if
the
previous record's field is identical?
 
D

Douglas J. Steele

Yeah, that might work. You can use that same function to determine which
rows need their colour changed to the same as the background (if the
function returns True), and which need a different colour (the False)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dan said:
I don't want to delete those values. Just make the text the same color as
background so they disapear. In other words, the row will still be
visible,
but some fields on the left won't be visible if the CustNum is the same as
the CustNum on the row above. Sorry for the confusion and thanks for
continuing to help!

Douglas J. Steele said:
I'm not sure it would work. In essense, you're trying to delete a value,
not
change how it appears. That's not what Conditional Formatting is intended
for.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dan said:
This is from another posting...would this work and if so, could you
help
me
modify code to my application...

I thought your question sounded too easy. So you want the Subject
field
to
be bold whenever the value of Subject is different than the previous
Subject?
That is a bit trickier and requires some VB.

Add a Global Variable to any module (or create a new one) to keep the
old
subject.

Global strPreviousSubject As String

Below that, add the function to check to see if the line should be
bold:

Function fBoldField(Optional ByVal strSubject As String) As Boolean
fBoldField = False
If IsNull(strSubject) Then Exit Function
If strSubject <> strPreviousSubject Then fBoldField = True
strPreviousSubject = strSubject
End Function

Then, for the conditional formatting of your Subject box, choose
Expression
Is with

fBoldField([User])

as the expression.

Whenever the fBoldField Function returns a true value, the conditional
formatting will kick in.



:

I'm not sure there is a way to accomplish that on a form. (It's
trivial,
of
course, to achieve it on a report.)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


in other words, i only need to hide part of the row if the row is
identical
as the row above vs. not showing the entire row which I could do by
eliminating dups in the record source

:

I don't believe it's possible.

Why not eliminate the duplicates from the recordsource by using the
DISTINCT
keyword in the query?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I know you can't hide duplicate rows of a continuous form while
leaving
other
visible. However, I think I can use conditional formatting. If I
can,
what
sort of expresssion would I put into the condition to check to
see
if
the
previous record's field is identical?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top