troubleshooting Question

Limit number of records for each person filling out a form

Avatar of SteveL13
SteveL13Flag for United States of America asked on
Microsoft Access
5 Comments1 Solution177 ViewsLast Modified:
I have a form which users use to enter records.  For each person filling out the form they are "assigned" a userID automatically which is a text ID.    The table also of course has a RecordID autonumber field.

Anyway, as the user is filling out the form, which is really a sub-form (continuous form), and have entered 5 records and attempt to enter a 6th record, I want a message to popup informing them that they can't enter any more records.

Something like this but I don't know how to qualify the userID:

Private sub Form_BeforeInsert(Cancel as Integer)
If Me.txtCount > 5 Then
    Cancel = True
    Msgbox "Please return a book before checking out a new one", vbOKOnly
End If
End Sub
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros