Date() function corruption

  • Thread starter Thread starter TC
  • Start date Start date
T

TC

I experience often the Date() function in code and as default data for date
fields giving me the error #Name?
office XP Access 2002, windows 2000. I have all the latest service packs for
both. Any ideas?


Yep: show us a fragment of the code in question!

Also, how can using the Date() function >in code< give you that error? That
error is displayed in a control on a form. It is not displayed by running
code.

A bit more information would not go amiss ...

HTH,
TC
(off for the day)
 
I experience often the Date() function in code and as default data for date
fields giving me the error #Name?
office XP Access 2002, windows 2000. I have all the latest service packs for
both. Any ideas?
 
Sorry for the confusion, #Name? is in a field on a new record with the
default value Date().
Function is not available in expressions in query expression 'Date()'
query:

DoCmd.SetWarnings (0)
DoCmd.RunSQL "UPDATE Jobs LEFT JOIN ChangeOrder ON Jobs.JobNumber =
ChangeOrder.JobNumber SET ChangeOrder.JobNumber = jobs.jobnumber,
ChangeOrder.ChangeNumber = 0, ChangeOrder.QN = jobs.quotenumber,
ChangeOrder.CNUnique = jobs.quotenumber*10 , ChangeOrder.[Date] = Date(),
ChangeOrder.COAmt = 0, ChangeOrder.Comments = 'Original Quote'" & _
" WHERE (((ChangeOrder.JobNumber) Is Null));"

additional info. this code worked for several months then quits with these
errors.
this is a recurring problem.
 
Sorry for the confusion, #Name? is in a field on a new record with the
default value Date().
Function is not available in expressions in query expression 'Date()'
This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
..DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.
 
thanks John, it worked as you said.
John Vinson said:
This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
.DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.
 
There is one problem that I have run into. Sometimes MS
Access throws out my references. To know if this happens,
I have a date on my main switchboard when the database
opens. If the field displays an error, I immediately know
that my references have been knocked out. I then go to a
module in design mode, click on tools and then references
and then check the appropriate references. I maintain a
screen print of my references to ensure that they are
replaced. If this problem is not database wide and more in
a specific location, from the book Troubleshooting Access
Databases for 97 and 2000 (probably holds true for newer
ones, here are some potential problems quoted from the
book.

1. The expression in the Control Source property box might
not be preceded by an equal sign.

2. The expression might include the name of fields or
controls with spaces in them that are not enclosed in
square brackets.

3. The expression might include the name of the control
itself. This creates a circular reference that Access
can't resolve.

4. The expression might refer to another control
incorrectly so that Access can't evaluate the expression.

This is a pretty good book, if you want to read about it,
it is at mspress.microsoft.com/troubleshooting
It is written in plain english for the non-programmer.

Hope this helps.
 
Back
Top