+ Reply to Thread
Results 1 to 4 of 4

Userform - Stop Command button working if a textbox is blank?

  1. #1
    Registered User
    Join Date
    11-16-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    34

    Userform - Stop Command button working if a textbox is blank?

    Hi There,

    I'm not sure if this is possible, but what I'm trying to do is create an error message that will prevent a user selecting the command button in a userform if a text bos is empty.

    I've attached a spreadsheet with a simple, example userform. What I would like to do is stop the user adding the record if the "service date" text box is empty. Idealy I would like an error message to display something like "please enter service date". Is this possible to do?

    Below is the code.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by revenge4ash89; 01-10-2012 at 05:52 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Userform - Stop Command button working if a textbox is blank?

    Why are you pre-populating the TextBoxes?

    Please Login or Register  to view this content.
    Last edited by royUK; 01-10-2012 at 07:10 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-16-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Userform - Stop Command button working if a textbox is blank?

    I'm pre-populating the textboxes because I have large amount of record information which can be easily edited through the userform . This spreadsheet is just an example.

  4. #4
    Registered User
    Join Date
    11-16-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Userform - Stop Command button working if a textbox is blank?

    Thank you so much for the speedy response RoyUK! That's worked perfectly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1