MS Access database - ensure gender and title match

  Templar1961 21:22 22 Sep 09

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 09

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

  Templar1961 22:43 22 Sep 09

That sounds good! How do I do that?

  hastelloy 10:42 23 Sep 09

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 09

My database is in MS Access, not MS Excel.

  Picklefactory 13:18 23 Sep 09

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 09

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.

The Legend of Zelda Breath of the Wild review: Five hours with Zelda on the Nintendo Switch

1995-2015: How technology has changed the world in 20 years

How the painting-like animated sequences in A Monster Calls were created by Glassworks Barcelona

The 22 best Safari extensions | Best Safari plugins: Improve Apple's Safari web browser with these…