Not the same minimum value for the same field

  • Thread starter Thread starter Paul Smith
  • Start date Start date
P

Paul Smith

Dear All

I am implementing a database to help the management of a club. There is
a table with the members of that club, where the name, age and gender
of each member are introduced. However, depending on the gender, the
minimum age is 18 and 16. How can I have Access preventing the
introduction of a member with an age below 18 if male and below 16 if
female?

Thanks in advance,

Paul
 
Create a Gender table and include the Minimum Age as a column.
When the gender is selected, reference the minimum age.

If you use a combo box to select the gender, keep the Minimum Age column
hidden.

HTH

--
Rob Mastrostefano

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com
 
I would recommend storing BIRTHDATE, not AGE. AGE is a moving target.
Someone may have been 15 a month ago when you entered them, but they are now
16. Maintaining this would become a nightmare. Instead, store only the
BIRTHDATE.

In your queries, reports, and forms you can use a formula to determine their
age. The standard formula is...
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(),"mmdd"))


Not sure what you mean by preventing introduction of a member, but you can
easily build a query to pull folks that are a certain gender and/or age.
 
Create a Gender table and include the Minimum Age as a column.
When the gender is selected, reference the minimum age.

If you use a combo box to select the gender, keep the Minimum Age column
hidden.

Thanks, Rob and Rick. The solution above is the one I thought before,
but I do not know how to "When the gender is selected, reference the
minimum age". Some help would be greatly appreciated.

Paul
 
Paul said:
Dear All

I am implementing a database to help the management of a club. There
is a table with the members of that club, where the name, age and
gender of each member are introduced. However, depending on the
gender, the minimum age is 18 and 16. How can I have Access
preventing the introduction of a member with an age below 18 if male
and below 16 if female?

Thanks in advance,

Paul

Rob and Rick are correct, but I wonder about that age - sex membership
thing. Is it legal?
 
Rob and Rick are correct, but I wonder about that age - sex membership
thing. Is it legal?

My example is imaginary, Joseph; I just want to learn the general
mechanism to deal with the situation "Not the same minimum value for
the same field".

Paul
 
Thanks, Rob and Rick. The solution above is the one I thought before,
but I do not know how to "When the gender is selected, reference the
minimum age". Some help would be greatly appreciated.

OK, I solved the problem with DLOOKUP (to reference the minimum age).

Paul
 
Back
Top