Here is how I use a MaskEdBox in code:Originally posted by TheBao
In MaskEdBox, I have the following code:
Now if the date part is less than 10, then it display only 1 integer, but the Mask expect 2 integer. So error occur.Code:medDOB.Mask = "##/##/##" medDOB.Text = Format(rstPlayer!sgcusbdate, "ddddd")
How can I make sure that the datepart is always 2 integers? (Note: I must use dateformat "ddddd" ie. vbshortdate since this is an international app.)
Thanks.
VB Code:
Dim tmpMask As String tmpMask = MaskEdBox1.Mask MaskEdBox1.Mask = "" MaskEdBox1.Text = <Some value goes here> MaskEdBox1.Mask = tmpMask
To put it simply, you extract the existing mask into a temporary variable, remove the mask, then set the text and reset the mask using the temporary variable. I am sure this will do the trick for you.
.





Reply With Quote