Record Count on Forms

  • Thread starter Thread starter Ray Hogan
  • Start date Start date
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
 
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
 
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
 
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.
 
Back
Top