View Single Post
  #4  
Old February 28th, 2010, 06:15 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Renewing member database design question.

Yes: a GROUP BY query will give you a read-only result.

You could work around that with a DMax() expression, either in your source
query or in the Control Source of a text box on your form:
=DMax("DateAdd(""yyyy"", [Years], [FromDate])", "PaymentsTable",
"ClientID = " & Nz([ClientID],0)

I would try to resist the temptation to store this value as a field in the
Person table, as this violates basic normalization rules ("Don't store
dependent data.")

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Dennis" wrote in message
...
[snip]
Your comment:
So, you type an expression like that into a query.
Group By the member.
Choose the Max of RenewDate.
That's when they are due again.

Response: I’ve already tried this approach. It was my understanding that
a
Group By and Max(RenewalDate) results in a read only query. One of my
requirements was the query support data entry so I can create a data entry
form around it. Sorry if I was not clear about that earlier. Since
membership renewals arrive in “bunches”, I want to have the continuous
form
entry screen. This screen will have a comb box for member name, and then
fields that allow me to enter the renewal information.

Using the Max() does solve the function of connecting the Client table to
the Payment table without having to worry about the payment term, but it
leaves me without the data entry capability I need.

That is why I was using the

SELECT tblMember.AcctNo, …..
FROM tblRenew RIGHT JOIN tblMailingList ON tblRenew.AcctNo =
tblMember.AcctNo
WHERE (((tblRenew.MemYear)=Year(Date())));

This join provided me with a data entry enabled query that I could use as
a
source for a data entry form, but then I have the issues of Life versus
Annual.

I could modify my data entry form to post the key to the last payment
transaction to the Client table as a foreign key and that would give me a
direct link. I would have both a data entry capable query and resolves
the
Life and Annual issues.