No New Records

  • Thread starter Thread starter sturner333
  • Start date Start date
S

sturner333

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
 
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

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top