Long Date and UCase

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why does Me.FieldName = Ucase(Me.FieldName) in the after update event not
work when the format of the texbox in a form is set for long date? How can I
capitilize a long date in a textbox on a form?
 
Try this:

Me.FieldName = UCase(Format(Me.FieldName, "Long Date"))

It is working for me.

Yanick
 
Why does Me.FieldName = Ucase(Me.FieldName) in the after update event not
work when the format of the texbox in a form is set for long date? How can I
capitilize a long date in a textbox on a form?

If FieldName is bound to a Date/Time field, bear in mind that a
Date/Time value is stored *AS A NUMBER* - a count of days and
fractions of a day (times) since midnight, December 30, 1899.

As such, it doesn't have upper or lower case. It's just a number.

The format is applied at display time. I suspect you'll need to set
the Control Source of a textbox to

=UCase(Format([fieldname], "Long Date"))

to get the effect you want - and that resulting text string field will
not be editable.

What's so much better about JANUARY over January?

John W. Vinson[MVP]
 
Thank you so much for your help.

John Vinson said:
Why does Me.FieldName = Ucase(Me.FieldName) in the after update event not
work when the format of the texbox in a form is set for long date? How can I
capitilize a long date in a textbox on a form?

If FieldName is bound to a Date/Time field, bear in mind that a
Date/Time value is stored *AS A NUMBER* - a count of days and
fractions of a day (times) since midnight, December 30, 1899.

As such, it doesn't have upper or lower case. It's just a number.

The format is applied at display time. I suspect you'll need to set
the Control Source of a textbox to

=UCase(Format([fieldname], "Long Date"))

to get the effect you want - and that resulting text string field will
not be editable.

What's so much better about JANUARY over January?

John W. Vinson[MVP]
 
Back
Top