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.