MS Access database - ensure gender and title match

  Templar1961 21:22 22 Sep 2009

I have a MS Access database with Title and Gender fields. I need to ensure that the Title and Gender fields always match i.e. Mr = Male and Mrs or Miss = Female. Whats the best way to do this? I would like a validation rule to do this.

  I am Spartacus 21:34 22 Sep 2009

Why not have it automatically populate the field depending on input to the Title field?

  Templar1961 22:43 22 Sep 2009

That sounds good! How do I do that?

  hastelloy 10:42 23 Sep 2009

Assuming column A has Mr, Mrs etc, put =IF(A1="Mr",M,F) into cell B1 (or whichever column you want to use) and copy it down the column. If the cell in column A is empty it will still show it as F. I'm sure there's a way to avoid this but I can't work it out.

  Templar1961 12:50 23 Sep 2009

My database is in MS Access, not MS Excel.

  Picklefactory 13:18 23 Sep 2009

I think it would edpend on how your database is constructed. I'm no expert, but I think you would need to create a query with just titles and genders, and then use a lookup in your main table that on entering a title, uses the lookup query to decide which gender that relates to. It might not be really simple, how good are you at Access?

  Woolwell 17:36 23 Sep 2009

I have forgotten how to do this but a calculated field when filling in a form is probably the way to go.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Best phone camera 2017

Stunning new film posters by Hattie Stewart, Joe Cruz & more

iPad Pro 10.5in (2017) review

28 astuces pour profiter au mieux de votre iPhone