Hi,
I hope someone can help.
I have a database with one table which will have duplicates in the database on purpose.
so the reference number will be duplicated and needs to remain in the database. The distinction would be the date. there are 12 other columns of information that need to be displayed, but below is an sample.
Ref Date
Ref-001 20/01/19
Ref-001 02/08/19
Ref-001 04/09/19
Ref-002 08/09/19
Ref-002 10/11/19
So I want to filter upon opening the form so that all the user will see is Ref-001 with date 04/09/19 and Ref-002 10/11/19 and not see the duplicated ref's because there need to be there for historical reasons.
I tried the MAX function in a query, which works, but as soon as I add more fields to the query to see more information relating to it, the max function doesn't work and I am seeing the other duplicates. Also I cannot edit the query linked form, as it is just a query not an editable source.
I was thinking of trying the filter function in form open event - so when the form opens, it will show what the query is meant to do. However I cannot find code to work to use max function or anything to help just filter out the duplicates.
would anyone be able to help with this one.
Private Sub Form_Open(Cancel As Integer)
Me.Filter = "First Issue Received by BH" = Max
Me.FilterOn = True
End Sub
I tried the code, but didn't like it.
I hope someone can help.
I have a database with one table which will have duplicates in the database on purpose.
so the reference number will be duplicated and needs to remain in the database. The distinction would be the date. there are 12 other columns of information that need to be displayed, but below is an sample.
Ref Date
Ref-001 20/01/19
Ref-001 02/08/19
Ref-001 04/09/19
Ref-002 08/09/19
Ref-002 10/11/19
So I want to filter upon opening the form so that all the user will see is Ref-001 with date 04/09/19 and Ref-002 10/11/19 and not see the duplicated ref's because there need to be there for historical reasons.
I tried the MAX function in a query, which works, but as soon as I add more fields to the query to see more information relating to it, the max function doesn't work and I am seeing the other duplicates. Also I cannot edit the query linked form, as it is just a query not an editable source.
I was thinking of trying the filter function in form open event - so when the form opens, it will show what the query is meant to do. However I cannot find code to work to use max function or anything to help just filter out the duplicates.
would anyone be able to help with this one.
Private Sub Form_Open(Cancel As Integer)
Me.Filter = "First Issue Received by BH" = Max
Me.FilterOn = True
End Sub
I tried the code, but didn't like it.