+ Reply to Thread
Results 1 to 11 of 11

Userform Syntax to have textbox display Msgbox when contents left unchanged

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Userform Syntax to have textbox display Msgbox when contents left unchanged

    I dont know how to do this and need help.

    I have mutiple textboxes on a userform that have values within the property called "Text." This textbox is for a date entry and I have "1/1/11" within the text property so that the user will know what format I would like the value to be entered as when the userform is activated for the first time.

    Problem is, I want a Msgbox to be displayed if the value is left unchaged so that if they were to submit the values to the database worksheet, then it would submit that default value of 1/1/11 - but require them to change it to the date of whatever they specify.

    So how can I make sure that they change the textbox contents?
    Last edited by clemsoncooz; 01-31-2012 at 06:02 PM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    By not diplaying the 'continue' button unless they entered the textbox.
    I'd prefer showing "15/01/2012" because only now it's clear what the format should be.



  3. #3
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    Quote Originally Posted by snb View Post
    By not diplaying the 'continue' button unless they entered the textbox.
    Hello snb. Thanks for the response.

    So hide my "submit" or "continue" button until that texbox is "changed?" I have (3) textboxs that require a change before I would want the user to continue. How do I make sure that all (3) have been changed?

    Texbox names are: tbxDesignDate, tbxConstDate, tbxPostDate

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

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook. Don't upload a picture when you have a workbook question. None of us is inclined to recreate your data. Upload the workbook and manually add an 'after' situation so that we can see what you expect. In addition clearly explain how you get the results..
    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Hope that helps.

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

    Free DataBaseForm example

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    Quote Originally Posted by royUK View Post
    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook. Don't upload a picture when you have a workbook question. None of us is inclined to recreate your data. Upload the workbook and manually add an 'after' situation so that we can see what you expect. In addition clearly explain how you get the results..
    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    As Requested....
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    just for msgbox....as an option
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  8. #8
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    Thanks for your reply john55.

    I see what your doing there and I ran it.

    Two Comments to make:
    1) When I say yes to the message box, I get an error. When I say no - it works ok.
    2) This isnt quite what I was looking for. If you bring up the sample document I upload, and ONLY put numbes into the (3) places that have the label "NUMBER" (not the date fields), htit submit, then I would like a msgbox to appear saying you need to change the (3) also. BUT if the user already change the (3) dates prior to hitting submit - then no msgbox would appear and just submit as entered. I believe that is why snb recommended to me to hide my submit button until those changes were made. And then once the dates where in fact change, then the submit button would appear. But I am having trouble getting that done as well.

    Overall, I just want the user to be notified that they MUST change the dates prior to hitting the "submit" button.
    Last edited by clemsoncooz; 01-26-2012 at 05:40 PM.

  9. #9
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    duplicate post

  10. #10
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    as I said, just test it!
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Userform Syntax to have textbox display Msgbox when contents left unchanged

    hope it helped!
    thanks!

+ 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