Results 1 to 6 of 6

Thread: [RESOLVED]welcome form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    23

    Resolved [RESOLVED]welcome form



    Hello everybody. actually i want to know how can i createa "welcome" form" which asks the user their name, then says "HELLO Mr./Miss <name>". The user is then given a choice viewing different pictures and accordingly the event takes place as per the optselected. This form should stop by clicking a suitable command button.
    plz help..
    Last edited by adad; Mar 29th, 2007 at 02:35 AM.

  2. #2
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: welcome form



    vb Code:
    1. Private Sub Command1_Click()
    2.     MsgBox "Hello " & Text1
    3.     Unload Me
    4. End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    23

    Re: welcome form

    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

  4. #4
    Lively Member
    Join Date
    Mar 2007
    Posts
    124

    Re: welcome form

    Code:
    MsgBox "Hello Mr./Miss " & Text1
    assuming text1 is the name of the textbox the user will be inputing to.

  5. #5
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    Re: welcome form

    Quote 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:
    1. Private Sub cmdButton_Click()
    2. Dim strName, strGender as String
    3. Dim intGender as Integer
    4.  
    5. strName = InputBox("Enter your first name")
    6. intGender = "InputBox("Enter 1 for male and 2 for female")
    7. If intGender > 2 then
    8. Msgbox "Incorrect gender number entered"
    9. Exit Sub
    10. End If
    11.  
    12. If intGender = 1 then
    13. strGender = "Mr."
    14. Elseif intGender = 2 then
    15. strGender = "Mrs."
    16. End If
    17.  
    18. Msgbox "Welcome " & strGender & " " & strName
    19.  
    20. Exit Sub
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    23

    Thumbs up Re: welcome form

    thnx for ur rply..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width