Problems with Date() on forms - Help Please

F

FatMan

Hi all:
I am now having problems with the Date function {Date()} on many forms in my
database. What I have done is create forms where the user can select the
desired criteria from combo boxes or fill in unbound text boxes. One of the
criteria the users would select/fill in is the date and for this I have used
the date function. For example the default value for the unbound text box
might be any one of the following:
=Date()
=Date()-1
=Date-Day(Date())

I have rolled out an update (the back end sets on our file server while the
front end resides on the local computer) and am now having the following
problem.

When the user opens the form the unbound text box with the date function
used to set the default value for the text box it is displayed as “#Name?â€.
To my knowledge this message only display when the function is misspelled.
When I go into design mode to try to fix the problem and retype the date
function and then switch back to form view I get the following error message:

The function you entered can’t be used in this expression.

* You many have used a DoEvents, Lbound, Spc or Tab function in an expression.
* You may have used an SQL aggregate function, such as Count, in a design
grid or in a calculated control or field.

To my knowledge I have not done any of the things the error message is
suggesting. The odd thing is on my computer I do not see either the “#Name?â€
or the above error message, yet I do see it on the client computers.

I have checked the “references†under the Tools menu and everything is the
same except for the “Rotated TextBox control†that is on my computer but not
on the clients. The forms and reports related to them do not use the Rotate
Textbox control.

I am using Access 2000. Sorry for being so long winded but thought I needed
to provide all the detail.

Any help is greatly appreciated,
FatMan
 
D

Dirk Goldgar

FatMan said:
I have checked the “references†under the Tools menu and everything is the
same except for the “Rotated TextBox control†that is on my computer but
not
on the clients. The forms and reports related to them do not use the
Rotate
Textbox control.


In all likelihood, that's the problem. Once you have a broken reference, it
prevents other references from being resolved. For some reason, VBA tends
to be the most sensitive to this -- maybe it is always resolved last; I'm
not sure. You must either remove the broken reference before rolling out
your updates, or else see to it that the referenced library exists, in the
same location, on the client computers.
 
T

Tom van Stiphout

On Wed, 12 Aug 2009 09:31:16 -0400, "Dirk Goldgar"

All true, except that "in the same location" is not needed: Access
will use the Registry to look up where the registered components
reside. Btw, this also tells you that components indeed need to be
registered (using a setup program, or manually using regsvr32.exe).

-Tom.
Microsoft Access MVP
 
F

FatMan

Dirk:
Thank you for the input. You were bang on.

Oddly enough VBA has top priority in my references with the Rotate Text
control being last.

Thanks for you help,
FatMan
 
D

Dirk Goldgar

Tom van Stiphout said:
All true, except that "in the same location" is not needed: Access
will use the Registry to look up where the registered components
reside. Btw, this also tells you that components indeed need to be
registered (using a setup program, or manually using regsvr32.exe).


You're probably right, Tom, though it's my understanding that in some cases
the referenced libraries must be in the stored location. I guess there's a
difference between components and libraries, or maybe in the means by which
they are registered. It's not something I know much about (obviously).
 
D

Douglas J. Steele

Even though VBA is the first reference, it's actually the last reference
Access checks. This allows you to replace VBA functions with your own
version.
 

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