restricting records

S

Steve Schapel

ParisRio,

Yes. A reasonably straightforward way to do this would be to use code
to check the number of existing records on the BeforeInsert event of the
form, and throw up a message box if the limit has been reached. You
could store the maximum records limit in a table, or I suppose it would
be reasonable to "hard-wire" this value into your code. For example...
Private Sub Form_BeforeInsert(Cancel As Integer)
If DCount("*","YourTable") >= 20 Then
Cancel = True
MsgBox "Only 20 records allowed."
End If
End Sub
 

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

Top