Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box Behaving Strangely

Status
Not open for further replies.

mkell1

Programmer
Mar 20, 2003
15
US
I'm hoping that someone has some ideas as to what is going on with my text box. I have an app that has several screens with text boxes that display date data. The value in the Default Value Property is:
=DateAdd("d", 1, Date())

This has been fine for the longest time and is currently working fine in production. I made a copy of the production database and copied it into the development environment to begin some modifications and now this default value is giving a problem. When I try to open the form, I get the message:

Run-Time Error '2447':
There is an invalid use of the .(dot) or ! operator or invalid parenthesis.

If I try to add a new text box to the forms and add the =DateAdd("d", 1, Date()) to the default value property, I get the following message:

The function you entered can't be used in this expression.
* You may have used a DoEvents, LBound, UBound, Spc, or Tab function in an expression
* You may have used an aggregate function, such as Count, in a design grid or in a calculated control or field

What bothers me so much about this is that it is currently running fine in production. I also have a copy of the database that was taken a week or two ago that is in the development environment that works just fine.

Any ideas as to what might be happening here?

Thanks,

Melissa

 
Check your references and fix any that appear as MISSING.
(Any open module in design view; Tools>References)
Then Debug.Compile to make sure all is OK.
 
I had already checked the references because that was my first thought as well. All of the references are identical and none are missing. Maybe I will try to remove all and then add them all back again.

The program also compiles fine and the error still occurs.

Any other suggestions?

Thanks!
 
Okay, strangely enough, when I removed the reference to Microsoft DAO 3.6 Object Library and re-added it, everything started to work fine. Can references become "corrupt" like that? I've never had that happen before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top