Link to home
Start Free TrialLog in
Avatar of kikimayhay
kikimayhayFlag for United States of America

asked on

MaskedTextBox removes preceding 0

I have a masked text box, for Birthdate. In the when grabbing and formatiing the data it is a date with preceeding zero's if necessary (05/05/2005)

However when it gets inseted into the masked text box it converts the aboexample date to look like 55/20/05__

The mask on the text box is 00/00/0000

Is there some way to get this to work correctly?
ASKER CERTIFIED SOLUTION
Avatar of srikanthreddyn143
srikanthreddyn143

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kikimayhay

ASKER

The Data is coming from a date field in a database table the line that assigns it is:
MaskedTextBox.text = Format(datatable(0)("DOB"), "MM/dd/yyyy")
and I get results as stated above
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've tried that as well, the really weird thing is I have the same control on another form  in the same program. It pulls the same data from the same table, and is formatted the same, yet somehow it works as intended.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Deleting and re-adding the control did not work. I had to delete the form and manually re-add all the controls (copy and pasting logic behind controls).  
I cannot recreate the behaviour. Not sure what was going on but it had to be somewhere within the form itself.
Dispursing evenly among comments