A
Allen Browne
Cancel the BeforeInsert event procedure of the form if the maximum number of
records is already present, and the user can't give the password:
Private Sub Form_BeforeInsert(Cancel As Integer)
If DCount("*", "Table1") > 30 Then
Cancel = True
MsgBox "No more!"
End If
End Sub
To get the password, create a small unbound form with a text box that has
its Input Mask peoperty set to Password. OpenForm in acDialog mode, and if
the password string does not match, you can set a variable so that when the
form is closed and control is passed back to the previous form, it knows to
cancel the event.
records is already present, and the user can't give the password:
Private Sub Form_BeforeInsert(Cancel As Integer)
If DCount("*", "Table1") > 30 Then
Cancel = True
MsgBox "No more!"
End If
End Sub
To get the password, create a small unbound form with a text box that has
its Input Mask peoperty set to Password. OpenForm in acDialog mode, and if
the password string does not match, you can set a variable so that when the
form is closed and control is passed back to the previous form, it knows to
cancel the event.