Restricting records

tilda

Registered User.
Local time
Today, 16:51
Joined
May 10, 2001
Messages
17
Hi Folks
Small problem here if any one can help!

I have two tables with a one to many relationship, does anyone know how to restrict the amount of records entered on the many side. For example if we have student details on the one side, some are only allowed to take five courses, my problem is how to restrict the amount of courses on the many side. If this makes sense to anyone please let me know if it can be done.


Thanks in advance
Tilda
 
One solution is to have an integer field CourseNo in your 'many' table with validation rule '<=5'.

However, if the 'no more than 5 courses' rule only applies to some students, you'll probably need to use code to do what you want.

hth

shay :cool:
 
Hi Shay

Thanks but unfortunately students can do different amounts of courses, but it does need to be controlled.

Tilda
 
Just thinking through this quickly - perhaps you can have a field on the student ID screen that you enter the number of courses that a student can do.

Then you can have some code (like a DCount or something) that counts up the number they have already registered for. If that number = the number they can take then don't allow the courses screen to accept any more new courses for that student.

Col
:cool:
 
Hi Colin
Yes I can try that; the extra field is not a problem. Would I do the code in the form?

Tilda
 
That would be best

Put it in the OnCurrent property 'cos it'll have to run for every record you view.

Col
:cool:
 
Thanks Colin
I'll give it a go
Tilda

PS Everyone have a Super Christmas
 

Users who are viewing this thread

Back
Top Bottom