"=Now()" problem

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have several reports which were created with Access'
wizard. In the lower left corner, the wizard created a
text box for the Date & Time, and used the "=Now()"
function. My problem? It doesn't work. On my report I
get:

#Name?

instead of the Date & Time.

If I remove it, then try to recreate it, I get:

There was an error compiling this function.
The Visual Basic module contains a syntax error.
Check the code, then recompile it.

I'm using Access 2000 SP3, running on XP, SP1.

What am I doing wrong? What's wrong with the wizard? If
I didn't want both the date and time, I probably wouldn't
care, but I do, and it does. :)

Thanks in advance,

Tom
 
The very first thing is to check your References. Go to any code window and
choose Tools > References from the Menu bar. Find any references that say
MISSING. Write down which one it is, then Uncheck the box and click OK.
Usually this solves the problem. Occassionally you have to go find and
install the missing reference (that's why you write it down), but most often
you don't.

If there are no missing references, check back.
 
Did that. Found only the first 4 (four) items checked.

Visual Basic For Applications
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library

I scrolled the entire list (a VERY LONG list),
no 'missing' anywhere to be seen. What should it look
like? Just a "- missing" appended to the item?

I "browsed" and found a .dll named datime (I think it
was). I clicked to "open" it, and it "checked" the
item "TIME" it for me. I tried my report again, still
broken. So I went back and UNchecked it.

Tom
 
I guess the next thing I would try is a Decompile. This is an undocumented
procedure, that has been tossed about on newsgroups for several years. It
removes ALL compiled code from the application. Occasionally, bits of stray
compiled code can get stuck in the application. Sometimes this code can
cause errors in your application.

Decompile is one way to get rid of them. After Decompiling, you recompile
from any code window.

I have more information about Decompile and how to use it on my website,
here:
http://www.rogersaccesslibrary.com/knowledge.html about halfway down the
page:
DecompilingDatabases.zip Explains the undocumented Decompile option in
Access

Another way is to create a New database, set all your references, and then
import ALL of the objects from the old to the knew.
 
Great! It worked. (I have Access 2k, not 97, and I
didn't see the dialog box your directions mention.)
Although...

Isn't "=Now()" supposed to be the Date & Time? I ask
because what I'm getting now, although not an error,
isn't the Date and Time. What I'm getting is:

"Friday, March 19, 2004"

And I can't find any docs to tell me how to get date and
time.

Thanks,

Tom
 
Sorry. I forgot to mention that the instructions are for Access 97. It
still works in 2000, but 2000 doesn't *tell* you that it worked, like it did
in A97.

Yes, Now() returns the date and time. Be sure you have the control
formatted so it shows the time value.
 
THAT did it!

Thanks so much.

The missing dialog box wasn't a problem, it was just that
I was expecting it, that's all. No biggie.

Tom
 
Back
Top