Date function misbehaving

  • Thread starter Thread starter Mark Stewart
  • Start date Start date
M

Mark Stewart

Hello,

I've got a simple database of 4000 records and about 40
queries to screen data. Been using this setup for a year.
Just last week, I started getting the error
message "Undefined function 'Date' in expression." I do
use the Date function to filter older records. I have not
changed the built-in Date function. And it was working a
week ago. The expression is "<Date()-360" to filter on a
field that is formated as a Date/Time field. The database
is replaceted. The function works on the replicated
database. I have rebuilt the query a coiuple of times
trying to troubleshot. No luck. Hmmm, time for a reinstall?
 
I need to expand just a bit. First, I just synced the
replica and now I get the same error message on that
computer. That is what I would expect.

Also, I use Microsoft Streets & Trips 2004 to import the
date (via a query). It recognizes the date function and
imports the correct data. Hope this helps explain this a
little better.

Thanks,
Mark
 
Your references are probably messed up.

This can be caused by differences in either the location or file version of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module (or open the
Debug Window, using Ctrl-G, provided you haven't selected the "keep debug
window on top" option). Select Tools | References from the menu bar. Examine
all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)
 
Hi Doug,

Thank you for your time. I'd agree that the problem is in
this mess somewhere. I developed the database. And it runs
on the computer used for development and my laptop. It
doesn't have any VBA or VB (other than that which is done
by MS). There were only 4 references checked and only 2
that I could deselect. Working through your steps didn't
resolve the issue. I'd guess it would be one of the other
reference libraries. Any idea which one it might be? There
were 30-40 directly from Microsoft. If I just did a
reinstall, do you think that might reset that library?

This stuff is a little over my head. I know just enough to
get into trouble, so that makes it fun. :)

Thanks,
Mark
 
The problem isn't going to be with any of the unchecked references. And
reinstalling is unlikely to make a difference, since the details about the
references are stored in the MDB. It's more likely that installing some
other software on the machine changed the version of one or more of the
referenced files, and it's unlikely that reinstalling Access would change
that (unless it was an ill-behaved application you installed, and it
installed older versions of the files)

One possibility is to create a new database and import everything from the
old database into the new database. However, since your database is
replicated, I'm not sure whether you can do that. I don't know enough about
replication: is there some other way to create a replica from the master?

Given the scenario you've described, I cannot think of any other possible
culprit than the references, though.

One comment, though. You mention "It doesn't have any VBA or VB (other than
that which is done by MS)."

Realistically, a replicated database shouldn't have any VBA in it. Your
application should be split into a front-end (containing the queries, forms,
reports, macros and modules), linked to a back-end (containing the tables).
Only the back-end should be replicated: you should never be replicating
code.
 
Back
Top