Consulting

Results 1 to 6 of 6

Thread: How to make a text box mandatory?

  1. #1

    How to make a text box mandatory?

    Hi guys

    How do I make a text box mandatory, so if the user clicks or tabs on to the next field it fires a error message?

    Any help would be much appreciated

    Thanks
    Mark

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Look at the Exit method of the TextBox.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Hi there

    I'm new to VBA so I don't understand what you're talking about

    Thanks
    Mark

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Do you know how to create a userform and assign events to controls?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Hi There

    I've found out how to do it now

    Thanks
    Mark

  6. #6
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    This might not be the answer you're looking for, but it's better to check for missing fields at the end of the data entry process, instead of interrupting the user every time they skip a field. Not every user fills out the same form the same way.

    For example, the code behind a Submit button that writes fields in your form to a database could check if all required fields are filled, and pop up a message box at that time.

Posting Permissions

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