unknown function Date() error

G

Guest

We recently upgraded from Office XP to Office 2003. I have a database that
was created under Access95 and has been updated, compacted, and repaired with
each new version.
Today, for the first time in 9 years I am receiving an "Unknown function
Date()" error. The current version of the database is copied one from last
year. It's a habit I have of making a copy each year. In the 2006 version,
the Date() function works just fine. In the 2007 version, opened today for
the first time in Office 2003, returns the error.
Could it be related to:
1) the table has 31 fields and I was trying to add a 32nd filed, or
2) MaxLock in the registry is set at 9500, or
3) The field I wanted to enter was Yes/No with a default value of False. I
whacked this last field thinking it might solve the problem, but no such luck.
 
D

Douglas J. Steele

Could be a problem with your References collection.

Go into the VB Editor and 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, on the Debug menu), 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)

Having said that, having different copies per year is seldom a recommended
approach.
 
G

Guest

Thanks for the tip. The different copies per year differ soely by the name of
the database. Nothing else.
 
J

John W. Vinson

Thanks for the tip. The different copies per year differ soely by the name of
the database. Nothing else.

So you will NEVER want to compare data from year to year?

Storing data in fieldnames is bad design. Storing data in tablenames
is even worse. Storing data (a year) in a database name is worse yet!!


John W. Vinson [MVP]
 
G

Guest

No need to compare year to year because:
1) Data only changes once a year
2) Additions (new records) to database occur less than 6 times a year
3) Table within database holds yearly changes by year and is shown as a
spreadsheet (?) subform
4) Names of backups include year in case active version craps out
5) So your enterprise doesn't backup data incrementally and keep the backups
separate with dates covered indicated? Naughty, naughty.
 
G

Guest

Right. I opened the primary form, went to Tools - Macros - Visual Basic -
References. I found one entry saying "MISSING - Office XP Web Components".
So, why on earth do I need web components in a database that will never see
the web or have a single character of HTML or XML in its code. Currently the
web functions I have are URLs in text fields and buttons on the Switchboard
to open two web sites.
To me it seems that Office 10 is NOT compatible with Office 11.
Any assistance would be greatly appreciated.
 
J

John W. Vinson

Right. I opened the primary form, went to Tools - Macros - Visual Basic -
References. I found one entry saying "MISSING - Office XP Web Components".
So, why on earth do I need web components in a database that will never see
the web or have a single character of HTML or XML in its code. Currently the
web functions I have are URLs in text fields and buttons on the Switchboard
to open two web sites.

See what happens if you just uncheck that reference. Does your form
still work? Do the URL's still work?

John W. Vinson [MVP]
 
G

Guest

I found the Office XP owc10.dll in three places on my PC. It is in two
folders under the Program Files\Common Files\Microsoft Shared\Web components
folder > \10; \10\1033 folders, and is in the Windows - System32 folder.
Just for giggles, I copied the DLL from the Common Files location to the
System32 folder to see if that worked. Nope.

I followed the steps under the references - browse - open dialog to add the
component. Nope, got a duplicate name error. Tried to change the priorities
of the MISSING entry and the found Office XP Web Components entries, moving
the former to the bottom and checking / unchecking the box and moving the
latter to the top where the MISSING notice was. Nothing.
The Main switchboard gives a missing function error when I try to click on
any of the buttons. The error reads:
The expression On Click you entered as the even property setting produced
the following error.
The expression you entered has a function name that the database can't find.
* The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro.

The buttons are either Open Form, or Run Macro. None work.
Clicking on the URL fields in the primary form opens the correct URL in IE6.
Copies of the same database result in the same results.
We just installed Win XP and Office 11 (2003). I noticed under Access - Help
- About Access there is no indication SP2 has been installed.

"Curiouser and curiouser", said Alice
 
J

John W. Vinson

I found the Office XP owc10.dll in three places on my PC. It is in two
folders under the Program Files\Common Files\Microsoft Shared\Web components
folder > \10; \10\1033 folders, and is in the Windows - System32 folder.
Just for giggles, I copied the DLL from the Common Files location to the
System32 folder to see if that worked. Nope.

What is the actual displayed name in the References box? Running
A2003, I don't see any reference to "Office XP Web Components",
checked or unchecked.
I followed the steps under the references - browse - open dialog to add the
component. Nope, got a duplicate name error. Tried to change the priorities
of the MISSING entry and the found Office XP Web Components entries, moving
the former to the bottom and checking / unchecking the box and moving the
latter to the top where the MISSING notice was. Nothing.

Did you try unchecking it altogether, leaving it unchecked, and seeing
if that works?
The Main switchboard gives a missing function error when I try to click on
any of the buttons. The error reads:
The expression On Click you entered as the even property setting produced
the following error.
The expression you entered has a function name that the database can't find.
* The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro.

The buttons are either Open Form, or Run Macro. None work.

If you open the Switchboard form in design view, and view the
Properties of these buttons, what's in the Click event? This error may
be altogether unrelated to the missing reference; it sounds like the
button is calling a nonexistant macro or function.

You might need to delete the Switchboard form and table, compact the
database, and use the Switchboard Wizard to rebuild a clean
switchboard.

One other question: do you have Tools... Options... General... Name
Autocorrect checked? If so, uncheck it! It's VERY buggy and can cause
problems like this.

John W. Vinson [MVP]
 
G

Guest

I opened the same DB on my home PC and everything worked just like old times.
So by process of elimination, I'd the install at worked is fouled up. No
error on the Date() function, no OnClick errors on the switchboards, no VBA
error or missing references.
Fascinating.
--
I know enuff to be dangerous.


John W. Vinson said:
I found the Office XP owc10.dll in three places on my PC. It is in two
folders under the Program Files\Common Files\Microsoft Shared\Web components
folder > \10; \10\1033 folders, and is in the Windows - System32 folder.
Just for giggles, I copied the DLL from the Common Files location to the
System32 folder to see if that worked. Nope.

What is the actual displayed name in the References box? Running
A2003, I don't see any reference to "Office XP Web Components",
checked or unchecked.
I followed the steps under the references - browse - open dialog to add the
component. Nope, got a duplicate name error. Tried to change the priorities
of the MISSING entry and the found Office XP Web Components entries, moving
the former to the bottom and checking / unchecking the box and moving the
latter to the top where the MISSING notice was. Nothing.

Did you try unchecking it altogether, leaving it unchecked, and seeing
if that works?
The Main switchboard gives a missing function error when I try to click on
any of the buttons. The error reads:
The expression On Click you entered as the even property setting produced
the following error.
The expression you entered has a function name that the database can't find.
* The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro.

The buttons are either Open Form, or Run Macro. None work.

If you open the Switchboard form in design view, and view the
Properties of these buttons, what's in the Click event? This error may
be altogether unrelated to the missing reference; it sounds like the
button is calling a nonexistant macro or function.

You might need to delete the Switchboard form and table, compact the
database, and use the Switchboard Wizard to rebuild a clean
switchboard.

One other question: do you have Tools... Options... General... Name
Autocorrect checked? If so, uncheck it! It's VERY buggy and can cause
problems like this.

John W. Vinson [MVP]
 
J

John W. Vinson

I opened the same DB on my home PC and everything worked just like old times.
So by process of elimination, I'd the install at worked is fouled up. No
error on the Date() function, no OnClick errors on the switchboards, no VBA
error or missing references.

It's VERY easy to get missing references - you don't even need to open
Access to do so. Often just installing SOME OTHER program will change
or move a .dll and cause the problem; the same database on another
machine will work fine but will give the error on the machine that's
been bollixed.

If you don't need the web reference just uncheck it.

John W. Vinson [MVP]
 
G

Guest

Access won't let me. Everytime I uncheck the Missing Reference, Access puts
it right back.
We have pretty much narrowed it down to something funky with my PC. The IT
gang had to swap out the HD and stuck in a HD clone. One of the techs and I
are going to check our respective personal PCs to see if there are any
differences to my work PC. He can get the database to run just fine on his
PC at work.
Fascinating.
 
G

Guest

Solved the problem. We had to go in and, using the command prompt, unregister
the Microsoft Office Web Components XP DLL file. When Acees was opened, it
went hunting for the MSOWC11.DLL (name?) and registered it. Problem solved.
 

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