Date Picker - empty values possible

TjS

Registered User.
Local time
Today, 15:01
Joined
Jul 18, 2007
Messages
126
Date Picker - current date

Hellow again,

I searched on datepicker or some searchkeywords like that, but didn't found anything of an answer which i could use, so please advise if you want:

Information:
1) in the db are two fields (begindate and enddate)
2) in my form are four DTPicker fields (begindate_from, begindate_to, enddate_from, enddate_to)
3) user is allowed to leave the enddate DTPicker fields blank

The enddate can be filled with information or not
The begindate is always filled with information

problem description:
on 3) i have a couple of questions:
a) how to leave the DTPicker fields for the enddate blank
(aa or..if possible, maybe a checkbox to de-activate the two dtpickerfields for the enddate)
b) how to finally use this blank field or unchecked dtpicker fields in the query.

Situation now:
In query:
field: Begindate:
Code:
between [forms]![mainform]![begindate_from) AND [forms]![mainform]![begindate_to]

field: enddate
Code:
Isnull([enddate] OR
between [forms]![mainform]![enddate_from) AND [forms]![mainform]![enddate_to]

The part IsNull([enddate]) is of course not used, because in my form the two fields (enddate from and enddate to) are always filled...

Question?
How to....

Thanks in advance for your answers/reactions! :)
 
Last edited:
i fyou leave endate blank what value should be in there? today or should it be the same date as the start date?
 
enddate can be empty

the enddate in the database can be empty, so there can be A value or NO value......(see my problem here ? :)
 
Your query grid will have 2 criteria rows
1 with the between... for both begin and enddate the second with the between for the begin date but for the enddate
Isnull(forms!mainform!enddate_from) And IsNull( forms!mainform!enddate_to)

Brian
 
datepicker empty value

I have succeeded to fill the criteria with that what you suggested, but (maybe a stupid question with an answer of the "oooooohhhh, that simple, huh?" kind)...how do i leave the datepicker empty? (there is always a date in the datepicker box as far as i know or can tell..)...
 
Oop! missed that point, never used a datepicker so cannot comment on the problem or solution.

Brian
 
OK so what I wrote before was rubbish.
Picked up a datepicker from the forum set up a simple database and a form and query. If a start and end date are filled select records between , if only startdate(text0) all records >=
When deleting the enddate(text2) on the form to get a null remember to hit ENTER to get it registered.
The following SQL worked

SELECT tblDates.MyDate
FROM tblDates
WHERE (((tblDates.MyDate)>=[forms]![form1]![text0]) AND (([forms]![form1]![text2] Is Null)=True)) OR (((tblDates.MyDate) Between [forms]![form1]![text0] And [forms]![form1]![text2]));

Perhaps you can build on this.

Brian
 
Thanks people...
I managed to control my form, by letting the date picker be filled anyway and used in the query the isnull value.

Thanks for the answers, reactions
 

Users who are viewing this thread

Back
Top Bottom