I am trying to get the DMax function to work differently than it is working.
I am retired and do volunteer work for a non-profit organization, as a Membership Chairman.
I have two related tables: tblMembership and tblMembersTrans.
The Membership table has all membership data, such as names, addresses, etc. The member's transactions are entered on the membership form which has all of the data from tblMembership and a sub form that contains, in some cases, for some members, transactions from 1998. One member has pre-paid his dues up to 2016. This later example will be discussed below.
Presently, after posting the transactions on the subform, I enter the year for the LastMembershipYrPaid field in the main form.
However, it seems since this information is already in related table (and query) for MembersTrans, I should merely be able to link the main form's field to a query for the last membership year paid. Please note that the automatically generated transaction IDs do not necessarily coincide with the last membership year transaction. That is, the last TransID for any member is not necessarily for the last year. For example someone might have paid for 2013 in January 2013 and later, upon being advised that they forgot to pay for 2012, might make a payment in February 2013 for the arrearage in 2012.
I tried a query with the following: DMax("MembershipYear","tblMembersTrans Query")
The problem with that is that instead of showing the last year paid for each member, it only showed the single largest number (the latest year) for 2016, for that one member that I mentioned earlier.
Another way of explaining this is to assume that a bank has many, many customers with checking accounts. They want a listing of the largest single deposit made by each customer/account. The Dmax formula, as it is working above, would only show one single deposit: the largest deposit made by the one customer who made the largest deposit of any customer.
Any help in refining the formula, or other suggestion as to how I can automatically obtain query results that would show the last year (largest number in the MembershipYear field) for each member without having to rely on manually typing in the information in the main form, as I do now, would be appreciated.
Thanks.
I am retired and do volunteer work for a non-profit organization, as a Membership Chairman.
I have two related tables: tblMembership and tblMembersTrans.

The Membership table has all membership data, such as names, addresses, etc. The member's transactions are entered on the membership form which has all of the data from tblMembership and a sub form that contains, in some cases, for some members, transactions from 1998. One member has pre-paid his dues up to 2016. This later example will be discussed below.
Presently, after posting the transactions on the subform, I enter the year for the LastMembershipYrPaid field in the main form.
However, it seems since this information is already in related table (and query) for MembersTrans, I should merely be able to link the main form's field to a query for the last membership year paid. Please note that the automatically generated transaction IDs do not necessarily coincide with the last membership year transaction. That is, the last TransID for any member is not necessarily for the last year. For example someone might have paid for 2013 in January 2013 and later, upon being advised that they forgot to pay for 2012, might make a payment in February 2013 for the arrearage in 2012.
I tried a query with the following: DMax("MembershipYear","tblMembersTrans Query")
The problem with that is that instead of showing the last year paid for each member, it only showed the single largest number (the latest year) for 2016, for that one member that I mentioned earlier.
Another way of explaining this is to assume that a bank has many, many customers with checking accounts. They want a listing of the largest single deposit made by each customer/account. The Dmax formula, as it is working above, would only show one single deposit: the largest deposit made by the one customer who made the largest deposit of any customer.
Any help in refining the formula, or other suggestion as to how I can automatically obtain query results that would show the last year (largest number in the MembershipYear field) for each member without having to rely on manually typing in the information in the main form, as I do now, would be appreciated.
Thanks.