Limiting records and restricting duplicates

  • Thread starter Thread starter Maggie
  • Start date Start date
M

Maggie

Hi there,

I am creating a database of 34 camps. Each camp has a
limited number of individuals it can accept. I want to
preset a maximum number of records for each camp. So say
if a camp can only take 50 people, I want on the 51st
person to say camp at max. But this is only limited to
campers and not staff.

Secondly.. I need to make sure that each camper can only
register for one camp...

Thanks

M~
 
----- Maggie wrote: -----

Hi there,

I am creating a database of 34 camps. Each camp has a
limited number of individuals it can accept. I want to
preset a maximum number of records for each camp. So say
if a camp can only take 50 people, I want on the 51st
person to say camp at max. But this is only limited to
campers and not staff.
I think you need to limit this at the form level - in the form where you enter the camp of the camper insert the following lines in the before update event:

"If dcount("camper","camper-table","[camp_no]=" & Me!camp_in_form) = 50 then
msgbox "Camp " & Me!camp_in_form & " is full"
cancel = true
me.undo
End if

Secondly.. I need to make sure that each camper can only
register for one camp...

Just make a field in the camper's table - camp_no

Thanks

M~
 
Back
Top