HOW TO LIMITATE NUMBER OF THE RECORDS IN A TABLE ?

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I need to limitate the number or the records introduced by a certain user
in
a table at a time ( let's say to 7) . Can it be done? How?

P.S. This is a temporary table, from which I am moving the records in
another one, and I need to print a report before moving them, containing
at most 7 records (a standardized one). The record are introduced using
a
form and saved with a cmd. button. I want not to alloud them to add the
eighth record.

Thank you!
 
Cancel the BeforeInsert event of the form:

Private Sub Form_BeforeInsert(Cancel As Integer)
If DCount("*", "NameOfYourTableHere") > 7 Then
Cancel = True
MsgBox "No more records!"
End If
End Sub
 
Back
Top