Automatically

Matizo

Registered User.
Local time
Today, 10:58
Joined
Oct 12, 2006
Messages
83
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,
 
In the Title textbox control's BeforeUpdate event, put this:

Code:
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.
 
Last edited:
Thanks a lot! :) But I think I will chage it just a bit :D

Regards,
Matt
 

Users who are viewing this thread

Back
Top Bottom