W
Wembly
Hi,
In recent times I have been doing a lot of DMax's (along
with DCount's and DLookup's) and later realised their
inefficiencies and inadequacies. I then moved on to DAO
and am starting to realise its benefits.
However, I'm in the process of converting old 'D...'
codes to DAO, and am having some difficulties in finding
an equivalent for the DMax.
For example, if I want to find the latest date of from a
subset of records that have the same ID (a foreign key),
how would I write it? E.g. my recordset has 100 rows, of
which 10 will be of relevance (e.g. ID = 6), and of those
10 records I want the one that has the latest date from a
dateField.
This is what I have currently written.
rs.FindLast "[dateField] > " ??? & "[ID] = " & PrimaryKey
The primary key changes all the time (depending on what
the user wants to see on the form) and is defined as an
integer. What should the ??? be?
Thanks.
In recent times I have been doing a lot of DMax's (along
with DCount's and DLookup's) and later realised their
inefficiencies and inadequacies. I then moved on to DAO
and am starting to realise its benefits.
However, I'm in the process of converting old 'D...'
codes to DAO, and am having some difficulties in finding
an equivalent for the DMax.
For example, if I want to find the latest date of from a
subset of records that have the same ID (a foreign key),
how would I write it? E.g. my recordset has 100 rows, of
which 10 will be of relevance (e.g. ID = 6), and of those
10 records I want the one that has the latest date from a
dateField.
This is what I have currently written.
rs.FindLast "[dateField] > " ??? & "[ID] = " & PrimaryKey
The primary key changes all the time (depending on what
the user wants to see on the form) and is defined as an
integer. What should the ??? be?
Thanks.