PDA

View Full Version : Trying to get a False result from DTPicker



Rlb53
09-02-2011, 06:52 PM
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:



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



Thank you for your help !

p45cal
09-03-2011, 12:58 AM
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)

Rlb53
09-06-2011, 05:36 AM
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