Record Count on Forms

R

Ray Hogan

Hi,
I have a Form (frmTeam) and a Sub Form (subfrmMember) and I wish to limit
the number of records to four (4) for each Form Record.
How do I get the Sub Form to count the number of Records?
Thanking you in anticipation.
Rayh
 
E

Ed Robichaud

One suggestion would be to modify your subForm's record source query to
select the last 4 records by date or some other field/value. Why the limit?
Are you confusing display space with data structure issues?
-Ed
 
R

Ray Hogan

Thanks Ed.
I have two tables (tblTeam to frmTeam) and (tblMember to subfrmMember) and
each team consists of 4 members. Therefore, I need to move to the next team
when I have entered 4 members.
Hope this makes sense.
Rayh
 
V

Van T. Dinh

My guess is that you can use the Form_AfterInsert Event of the Form
subfrmMember to count the number of Records in the Subform and take
appropriate action, e.g. setting AllowAdditions to False.

You will also need to consider the number of Members when the Main Form
moves from one Record to another.

You also need to consider the case where the Subform already has 4 Records
and the user deletes one Member. In this case, the AllowAdditions should be
change from False to True.

It is actually fairly complex if you want to consider all user's actions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top