Attached is an example that should be similar to your situation.
Form & subform based on tblSale & tblSaleDetails with SaleID as PK & FK respectively
The table relationship is an OUTER join so extra records can be added up to the record limit
The code limiting the records is in the Form_current event of the subform
Code:
Private Sub Form_Current()
If Me.Dirty Then Me.Dirty = False
Me.AllowAdditions = DCount("*", "tblSaleDetails", "SaleID = " & Me.SaleID) < Nz(DLookup("MaxRecords", "tblRecordLimit"), 0)
End Sub
You can set the record limit on the main form - currently this is 5.
This value is stored in a separate table tblRecordLimit
Alternatively just set your own fixed value (e.g. 10), remove the table & form controls and alter the above code to:
Code:
Me.AllowAdditions = DCount("*", "tblSaleDetails", "SaleID = " & Me.SaleID) < 10
Hope this helps
NOTE: Do NOT allow end users access to the tables otherwise they will still be able to add additional records