Home All Groups Group Topic Archive Search About

VB05 Express Date/Time Picker control

Author
22 Mar 2006 9:08 PM
Darhl Thomason
I'm converting my Access 2003 VBA app.  I have a number of date fields in my
db that I want to use the date/time picker control with, but if there is no
entry in my database, I want the date/time picker to show no date.  Right
now the first time it shows a blank date record, it inserts today's date.
But as I move through the db and it finds a date in that field, the next
time it finds a blank data record, it uses the last one as the default.  It
does not insert the date into the db, it just displays it.  I really need it
to display a blank unless there is a date in that field.

I'm semi-experienced with VBA, but a total rookie with BO Express Edition.

Thanks!

Darhl

Author
23 Mar 2006 12:30 AM
I Don't Like Spam
Darhl Thomason wrote:
Show quoteHide quote
> I'm converting my Access 2003 VBA app.  I have a number of date fields in my
> db that I want to use the date/time picker control with, but if there is no
> entry in my database, I want the date/time picker to show no date.  Right
> now the first time it shows a blank date record, it inserts today's date.
> But as I move through the db and it finds a date in that field, the next
> time it finds a blank data record, it uses the last one as the default.  It
> does not insert the date into the db, it just displays it.  I really need it
> to display a blank unless there is a date in that field.
>
> I'm semi-experienced with VBA, but a total rookie with BO Express Edition.
>
> Thanks!
>
> Darhl
>
>

How are you attaching the data to the datetimepicker?

Chris
Author
23 Mar 2006 11:20 AM
Larry Lard
Darhl Thomason wrote:
> I'm converting my Access 2003 VBA app.  I have a number of date fields in my
> db that I want to use the date/time picker control with, but if there is no
> entry in my database, I want the date/time picker to show no date.  Right
> now the first time it shows a blank date record, it inserts today's date.
> But as I move through the db and it finds a date in that field, the next
> time it finds a blank data record, it uses the last one as the default.  It
> does not insert the date into the db, it just displays it.  I really need it
> to display a blank unless there is a date in that field.

This is a common request as far as the DateTimePicker goes.
Unfortunately, it doesn't have a 'natural' way to display null data.
The closest built-in behavior is the ShowCheckBox property, which adds
a checkbox into the control, and disables the date picking part if the
checkbox is unchecked. It looks terrible (to my mind), but it's there.

--
Larry Lard
Replies to group please