A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting up a count to restrict registrations



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2005, 04:18 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default 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  
Old December 7th, 2005, 05:03 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 08:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.