View Full Version : Automatically


Matizo
01-31-2007, 02:48 PM
Hello,

Is that possible to set the attributes so that when I enter "Mr" to a "Title" field the "Gender" field will automatically change to "Male"?

Or is that just a data duplication?

Regards,

Moniker
01-31-2007, 03:05 PM
In the Title textbox control's BeforeUpdate event, put this:

Select Case Me.Title
Case "Mr", "Mr."
Me.Gender = "Male"
Case "Mrs", "Mrs.", "Ms", "Ms.", "Miss"
Me.Gender = "Female"
Case Else
Me.Gender = "It's Pat!"
End Select

I wouldn't recommend storing the word "Male" or "Female" though. Make it a number and use a lookup. 1 = Male, 2 = Female.

Using a numeric lookup makes sense because with 10,000 records, you are storing 10KB of data compared to 50KB+ of data with full words. If you'd rather not use numbers and a lookup table, use "M" or "F". It's the same effect.

Matizo
01-31-2007, 03:12 PM
Thanks a lot! :) But I think I will chage it just a bit :D

Regards,
Matt