Booking Times

Keith166

Registered User.
Local time
Tomorrow, 06:00
Joined
Nov 4, 2007
Messages
43
I have created a database using access 97 which is used to register players tee off times at my golf club. A tee off time report is then created and emailed out of access to the pro shop. My problem is that sometimes the opertator inadvertantly enters 5 names instead of 4 for a tee off time. What can be done to check the data input for 5 tee off times and alert the opertator before he emails the booking report. The data is entered in a Subform within the main form.
 
If I understand you question; you want to restrict the number of entries to the subform to 4................am I correct.

If so then post back, I have sample db that restricts the number of entries to a subform.
 
Yes that's right John
 
Hi Keith,

One approach would be that after each entry into the subform of the players name do a "Dcount" of the subform. If this value is 4 then set the subform "allow addition" to No.
Thus not allowing any more entries.

Garry
 
Keith,

What Garry said is the way that I have done it.

This little bit of code from my subform may assist you;

Code:
Private Sub PartNumber_AfterUpdate()
Dim iAllow As Integer
iAllow = DLookup("[NumberAllowed]", "tblNumberAllowed")
    If Me.RecordsetClone.RecordCount >= iAllow Then
        MsgBox "This would exceed the maximum allowed", vbCritical, "Add Record Cancelled"
        Me.Undo
        Me.Form.AllowAdditions = False
    End If

End Sub

I used a table to store the "allowable" number and then used DLookup.

If you require any further help post back.
 

Users who are viewing this thread

Back
Top Bottom