I have a form that is populated witha query. I would like to not allow the
form to keep forwarding to new blank records. For example there are 12
records, when you use the record controls and get to record 12, you are not
allowed to go to 13, or at least not 14.
Thanks for the help.
Also, the Allow No New Record property doesn't help me. I would like to allow
a new record under certain conditions. I could do it in VBA if there is a
way. Thanks
> I have a form that is populated witha query. I would like to not allow the
> form to keep forwarding to new blank records. For example there are 12
> records, when you use the record controls and get to record 12, you are not
> allowed to go to 13, or at least not 14.
> Thanks for the help.
John W. Vinson - 18 Dec 2007 00:15 GMT
>Also, the Allow No New Record property doesn't help me. I would like to allow
>a new record under certain conditions. I could do it in VBA if there is a
[quoted text clipped - 5 lines]
>> allowed to go to 13, or at least not 14.
>> Thanks for the help.
You'll need to put code in the Form's BeforeInsert event:
Private Sub Form_BeforeInsert(Cancel as Integer)
If <conditions> Then
MsgBox "Only 12 records please!", vbOKOnly
Cancel = True
End If
End Sub
where <conditions> is an expression that is true if the user has hit the limit
of allowed records.
John W. Vinson [MVP]