> I have a masked edit box which has a value of "8/30/2004", and when i
programically set the value to mskedbox1=date, the vb blows up with an
invalid property value error. any ideas? It works ok if i set
mskedbox1="08/30/2004", but I can't seem to get the date value into
the box. I've even tried using format(date,"Short Date") to no avail. Format
and mask properties of the box are set to ##/##/####
Don't set the Format property (only set the Mask property) and assign
the Date this way...
mskedbox1.Text = Format$(Date, "mm/dd/yyyy")
Note that I specify the Text property rather than assume VB will apply
it as the default property. Do so will make reading your code much
easier six months to a year from now when you (or, if you are working in
a company, the person assigned to the task) have to modify your code. As
for the form of the Format function's specification string... it much
match the format of the Mask property character for character (that
means leading zeroes must be preserved).
Rick - MVP