If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Setting up a count to restrict registrations
I'm constructing a database for a summer camp and I need to be able to
allow only a certain number of male and female registrations per camp session as well as only a certain number of waterskiing and wakeboarding campers per session. Right now I have a form that uses a dropdown to select a camp session and checkboxes for waterskiing and wakeboarding. How can I implement the above limits to display a msgbox() when a camp session is full or waterskiing or wakeboarding is full for that session? |
#2
|
|||
|
|||
Setting up a count to restrict registrations
"Jordan Hiebert" wrote in message
oups.com... I'm constructing a database for a summer camp and I need to be able to allow only a certain number of male and female registrations per camp session as well as only a certain number of waterskiing and wakeboarding campers per session. Right now I have a form that uses a dropdown to select a camp session and checkboxes for waterskiing and wakeboarding. How can I implement the above limits to display a msgbox() when a camp session is full or waterskiing or wakeboarding is full for that session? You'd need to store the upper limit number in a table, then in the form's Before Update event, count the number of records in the form's recordset and compare it with the stored value (untested): Dim rs as Recordset 'You may want to define DAO.Recordset or ADO.Recordset there Set rs = Me.RecordsetClone If rs.RecordCount DLookup("MyField","tblMyTable") Then 'Message box warning here Cancel = True End If rs.Close Set rs = Nothing "MyField" and "tblMyTable" are where your stored total is. HTH - Keith. www.keithwilby.com |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row | Sam via OfficeKB.com | Worksheet Functions | 6 | November 29th, 2005 03:27 PM |
Counting rows in a Query | Janet | General Discussion | 9 | January 9th, 2005 05:13 PM |
count individuals of a certain sizes in one query | jw | Running & Setting Up Queries | 4 | June 23rd, 2004 08:16 PM |
Joining two count results | Adam Pedder | Running & Setting Up Queries | 4 | June 14th, 2004 04:59 PM |
Count function | mkingsley | Worksheet Functions | 2 | April 7th, 2004 04:02 PM |