simple datetimepicker questions

G

Guest

This example deals with a datetimepicker Date of Birth concept for a windows
form in VB 2005.

Simply put, if a user wants to enter the MM/DD/YYYY using the number pad,
how can I advance the cursor to the DD and then the YYYY without needing to
use the "/" key?? So the keystrokes look like "07041978" versus doing
"07/04/1978".

Secondly - if we don't know the D.O.B. at the time of input, we'd like to
make update the dataset with a blank (null) value.

Thanks much.
 
C

Cor Ligthert [MVP]

Mafandon,

Have you ever looked to one of the thousand samples on internet about a
Numeric textbox.
What you ask you can do in the same way.

This are the answers limited to the microsoft.public.dotnet.languages.vb
newsgroup which is probably more suitable for your question because you need
the answer in code.
http://groups.google.com/group/micr...ic+textbox&qt_g=1&searchnow=Search+this+group

You can create for your dbnull date in my opinion a check if 01010001 is
entered (the lowest date possible in DateTime and than change that for a
nothing (system.vbnull) in your database.

I hope this helps,

Cor
 
G

Guest

Thanks Cor,

It sounds like the answers for both questions are no? I've removed the drop
down box and am just using a maskedtextbox formatted for dates.

I didn't want to have to add another insert statement to my tableadapter for
inserting values into my table excluding the DOB column, but I guess that's
the answer there as well. I'll perform a check on " / /" and use the
appropriate insert statement.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top