mask textbox problems

  • Thread starter Thread starter Elaine16025
  • Start date Start date
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
 
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.
 
Back
Top