+ Reply to Thread
Results 1 to 13 of 13

INPUT BOX: Null Values

  1. #1
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    INPUT BOX: Null Values

    1) Need to ensure there are no NULL values in return from Input Box, zeros are OK, but not blanks.

    Please Login or Register  to view this content.
    2) Similarly, in another instance I need to "validate" data to force user to enter a negative value.

    3) Can you get rid of the cancel button on an INPUT BOX like you can a MSG BOX?

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: INPUT BOX: Null Values

    Try this, it will 'take care' of the cancel button

    Please Login or Register  to view this content.
    you can also add an aditional criteria like - number

    Please Login or Register  to view this content.
    if you wanted, you could break you 'validation' down into stages and add msgbox's to indicate why it failed as well.
    Last edited by DGagnon; 04-17-2012 at 12:52 PM.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: INPUT BOX: Null Values

    works perfectly. thank you very much.

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: INPUT BOX: Null Values

    no problem, good luck with the rest of the project.

  5. #5
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: INPUT BOX: Null Values

    The TYPE=2 (date) is giving a mismatch error.

    I have about 16 different input boxes. Most are strings. A couple are dates.

  6. #6
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: INPUT BOX: Null Values

    on what line?

  7. #7
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: INPUT BOX: Null Values

    Please Login or Register  to view this content.
    If admit_date <> Empty And admit_date <> "False" Then IS GIVING A TYPE MISMATCH ERROR

  8. #8
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: INPUT BOX: Null Values

    i was nto able to recreate the error, what are you entering into the text box?

  9. #9
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: INPUT BOX: Null Values

    I entered: 01/18/07

  10. #10
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: INPUT BOX: Null Values

    sorry it is still working for me, i cannot recreate the error you are getting, you could try splitting the conditions into 2 different nested if's and see if you can isolate which one is causing the error and work around that.

  11. #11
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: INPUT BOX: Null Values

    did you Dim admit_date as a date? It'll give an error. as a string it will not.

    this will error out.

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Re: INPUT BOX: Null Values

    Dim admit_date as String
    Converted it later to date using i_ad = CDate(admit_date)

  13. #13
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: INPUT BOX: Null Values

    you coudl store the value in a temp variable until after it passes the checks, then move it over to your date variable. you can use CDATE to convert it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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