forms and recdotrds

  • Thread starter Thread starter Ps
  • Start date Start date
P

Ps

I have a form and sub form where i add additional records
within the sub form for each item in the main form.

I wish to ensure that only a maximum of 14 records are
permitted to be added in the subform and once the 14 are
added to prevent further records being added.

How can i do this please??
 
Put the following code in the subform's Current event:
If Me.RecordsetClone.RecordCount = 14 Then
MsgBox "The Subform Has Reached Its Maximum" & VbCrLf _
& "Number Of Records Of 14",,"No More Records Can Be Added"
Me.AllowAdditions = False
Else
Me.AllowAdditions = True
End If
 
Back
Top