HEY guys!
does ne1 know how to limit the number of records being entered into a subform? for example i wanna be able to enter 10 records but not over 10 !!!! HELP! PLEASE!!
Try adding the following code to the Before Insert event of your subform:
Private Sub Form_BeforeInsert(Cancel As Integer)
MaxRecords = 10
Dim F As Form: Set F = Me
If F.RecordsetClone.RecordCount > MaxRecords Then
MsgBox "Maximum number of records in subform(" & MaxRecords & " exceeded. " & _
"Further additions not allowed. "
DoCmd.CancelEvent
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.