Consulting

Results 1 to 3 of 3

Thread: Trying to get a False result from DTPicker

  1. #1
    VBAX Contributor
    Joined
    Aug 2011
    Posts
    126
    Location

    Trying to get a False result from DTPicker

    Hello All,

    Within a Userform Data is being entered.
    The Date associated with the Data may not coincide with the current date.
    Utilizing DTPicker in the userform I want to force the user to check the date prior to the data being accepted.

    I have activated the Checkbox feature.

    I cannot get the "IF" command to recognize the lack of the checkbox being initialized as a "Nullstring".

    How may I get a result from an unchecked DTPicker that will allow the "If" command to exit sub until the Date is confirmed ?

    I'm hoping for something along the lines of:

    [vba]

    If dtpicker1=nullstring then
    msgbox"Confirm the Selected Date"
    dtpicker1.setfocus
    exit sub
    end if

    [/vba]

    Thank you for your help !

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    try the likes of
    if isnull(userform1.DTPicker1) then
    which returns True/False
    whereas your
    dtpicker1=nullstring
    returns Null/False

    (you won't need to qualify DTPicker1, as I have, if the code is in the userform'scode module)
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Contributor
    Joined
    Aug 2011
    Posts
    126
    Location
    It's been a few days since I've been on 'puter... but I recieved the response this morning and YES... The Isnull command cured the issue.

    Thank you p45cal

Posting Permissions

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