Text Box Date Format

M

Michael

Hi Folks - I have a text box on a report. The underlying query was modified
to display the date in MMM dd, yyyy format. When I run the query, the date
is formatted properly. However, the text box that refers to the query date
field still displays in mm/dd/yyyy format. Note: The control source of the
text box uses concatenation. It looks something like this:

="Today's date is "&[datefield]

Any ideas?

Michael
 
R

Rick Brandt

Michael said:
Hi Folks - I have a text box on a report. The underlying query was
modified to display the date in MMM dd, yyyy format. When I run the
query, the date is formatted properly. However, the text box that
refers to the query date field still displays in mm/dd/yyyy format.
Note: The control source of the text box uses concatenation. It looks
something like this:
="Today's date is "&[datefield]

Any ideas?

Michael

Formats set with the format *property* are not inherited by the next object
that might refer to the thing you formatted. You can use the Format()
function either in your query or in your report expression.

Note that if you use it in the query the output of that field will no longer
be an actual DateTime type, but instead will be a string. That means it
will sort as a string and compare as a string instead of a date. For that
reason it is normally best to wait till the spot where you are actually
displaying the value to apply the format function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top