mask textbox problems

E

Elaine16025

Hi Everyone,

I am using the VB 2005 database configuration wizard to build a form
displaying the records from a SQL table. The problem is the masked
textbox. The mask I set to is short date 00/00/0000, but it displayed
the dates wrong. For example, if the DOB in the database is
"02/03/1990", it displays "23/19/90__".

The other problem I have is, sometimes there is no DOB data to
document, so I need to leave it blank, but it would not allow me to
leave the textbox control, if I don't provide it with a date! (The DOB
column in SQL database is set to "allow null")

Any help would be greatly appreciated!

Pal Frustrated
 
C

cfps.Christian

Hi Everyone,

I am using the VB 2005 database configuration wizard to build a form
displaying the records from a SQL table. The problem is the masked
textbox. The mask I set to is short date 00/00/0000, but it displayed
the dates wrong. For example, if the DOB in the database is
"02/03/1990", it displays "23/19/90__".

The other problem I have is, sometimes there is no DOB data to
document, so I need to leave it blank, but it would not allow me to
leave the textbox control, if I don't provide it with a date! (The DOB
column in SQL database is set to "allow null")

Any help would be greatly appreciated!

Pal Frustrated

I had a similar problem with the dates, I had to parse it out so that
it would read "02/03/1990" meaning:

if dt.Month < 10 then strDate = 0 & dt.Month & "/" else strDate = 0 &
dt.Month & "/"
if dt.Day < 10 then strDate &= 0 & dt.Day & "/" else strDate &= dt.Day
& "/"
strDate &= dt.Year

I've not heard of the not being able to leave the control without a
date, you might just need to change a validation property somewhere in
the designer.
 

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

Similar Threads

Masked TextBox 3
Access General Date Forced To Have Date And Time 2
Input Mask 1
textbox mask 1
MaskedTextBox Help 3
Input mask for date! 0
Input Mask oddity - BUG? 7
if textbox entry is blank, add "unknown" automatically 1

Top