Hello
I have a subform on a form and I want to limit the records that can be entered in it to be no more than 100. I've tried doing this in VBA with the code below. What I get when I test this is the msgbox appearing twice and I can't delete the extra record (and it wont undo itself). How should I change the VBA?
Thanks
pamount
Option Compare Database
Option Explicit
Sub Form_Current()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
If rst.RecordCount >= 100 Then
Me.AllowAdditions = False
Me.Undo
MsgBox "Not allowed more than 100 plans in bag", vbOKOnly
Else
Me.AllowAdditions = True
End If
End Sub