How can I display a two digit year in an Access 2003 report?

B

Bobk

I tried your suggestion in a report. The result was an error - "Control has a
reference to itself". Any suggestions as to what I'm doing wrong?

'69 Camaro said:
In the Control Source Property of the text box, try:

=Format([FromDate],"mm\/dd\/yy")

.. . . where FromDate is the name of the field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.
 
6

'69 Camaro

It will try to "reference itself" if you use the same name for the control as
you've used for the field. (I know -- that's what the Report Wizard named
the text box. If you want to waste time chase bugs, _accept_ the defaults
you are given. But if you want your application development tasks to work on
the first try, then rename all of the controls that are going to be
referenced by VBA or property settings as soon as the Wizard is done creating
any new forms and reports.)

Rename your control. For example, if it's named FromDate (the name of the
field), then change it to txtFromDate to indicate it's a text box displaying
the FromDate.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Bobk said:
I tried your suggestion in a report. The result was an error - "Control has a
reference to itself". Any suggestions as to what I'm doing wrong?

'69 Camaro said:
In the Control Source Property of the text box, try:

=Format([FromDate],"mm\/dd\/yy")

.. . . where FromDate is the name of the field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.
 
K

Ken Snell [MVP]

And to add to Gunny's comments, then watch out that ACCESS doesn't also
change the name of the field in the Format expression to the new name of the
control.. sometimes ACCESS will do this for you, and you'll need to change
the Format expression's field back to the correct field name.
 
B

Bobk

Thanks for the help, Gunny & Ken. I have solved my problem thanks to your
direction. As you can tell I am a beginner in the world of Access and can use
all the help I can get.
 
Top