Limit Entries for a particular date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey everyone, I got a stumper.
I have a table where I track attendance.
It holds the date, time, name, and UserID.

Is there any way or a good method to only allow 30 entries per day.
I thought about doing a query that does a count on the date and then somehow
allowing/disallowing the entry.

Any ideas???
 
Hey everyone, I got a stumper.
I have a table where I track attendance.
It holds the date, time, name, and UserID.

Is there any way or a good method to only allow 30 entries per day.
I thought about doing a query that does a count on the date and then somehow
allowing/disallowing the entry.

Any ideas???

You can use the Form's BeforeUpdate event and use DCount:

Private Sub Form_BeforeUpdate(Cancel as Integer)
If DCount("*", "YourTableName", "[Datefield] = #" & Me!txtDatefield _
& "#") > 30 Then
MsgBox "Sorry, only thirty a day", vbOKOnly
Cancel = True
Me.Undo
End If
End Sub


John W. Vinson[MVP]
 
Back
Top