
Originally Posted by
adad
hi.. thnx for the rply but i want to know if the person write his / her name then mr/miss is come frst before his/her name and how can the user is then given a choice viewing different pictures and thereby accordingly the event takes place as per the option selected
If you are wanting to determine the gender of the user based solely on their name, good luck. You would need to create a massive database or reference file with every name and the gender associated with it. Not to mention the thousands of names that are not gender specific. Plus, what if the woman is either a Mrs, Miss, or Ms. Way too many combinations.
You could prompt them to enter a gender and do it that way. Like this:
vb Code:
Private Sub cmdButton_Click()
Dim strName, strGender as String
Dim intGender as Integer
strName = InputBox("Enter your first name")
intGender = "InputBox("Enter 1 for male and 2 for female")
If intGender > 2 then
Msgbox "Incorrect gender number entered"
Exit Sub
End If
If intGender = 1 then
strGender = "Mr."
Elseif intGender = 2 then
strGender = "Mrs."
End If
Msgbox "Welcome " & strGender & " " & strName
Exit Sub