Using Hide duplicates in reverse

  • Thread starter Thread starter John Baker
  • Start date Start date
J

John Baker

I can display a field in a textbox and then use the "HideDuplicates"
property to not repeat the same values. This would show the reoccurring
value at the top of the list.
My problem is that I need to show the reoccurring value at the bottom of the
list.

Any ideas on how to do this?
 
John said:
I can display a field in a textbox and then use the "HideDuplicates"
property to not repeat the same values. This would show the reoccurring
value at the top of the list.
My problem is that I need to show the reoccurring value at the bottom of the
list.

Hope you're still looking for an answer after all this time.

Anyway, I think I finally came up with a way to address this
issue. First, there is no way to get the HideDuplicates
feature to do this, so get rid of that stuff. Anyway, it's
almost always better to use the Sorting and Groping feature
to "clump" records with the same value.

Create a group on the field that you want to do this for and
set the group's Group Header property to Yes. Create a text
box named txtGrpCnt in the header section, set its control
source expression to =Count(*). Set the group header
section's Visible property to No.

The next thing we need to do is number each detail in the
group so we can determine which one is the last one. In the
detail section, create a text box named txtLineNum, set its
control source expression to =1, RunningSum to Over Group
and Visible to No.

Now, let's say the text box bound to the field with
duplicates is named txtTheField. Then, you can use a line
of code in the detail section's Format event procedure:

Me.txtTheField.Visible = (txtLineNum = txtGrpCnt)
 
Back
Top