Discussion Locked

Access97 Date() function won't work

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have used the Date() function MANY times in the db's I write. I am now finding that some of the users get the system date returned and some get the #Name? error. If I try to add a new field using Date() I get this error:

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

*You may have used a DoEvents, LBound, UBound, 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.

I amobviously not doing any of those things to get the error. Nothing on TechNet or MS website is finding anything. Why will it work on some pc's and not others? I haven't been able to find a connection.

11 replies

by mbarker734

I assume you are attempting to place the current date in a field.

If so use:

Now()

If not give me a little more explaining on how you are trying to use it and I will work you through it

Good luck,

Mark

by mbarker734

Also is it possible when you used date that you left off the parenthesis or did not type it as

=Date()

Again good luck,

Mark

by mbarker734

To retrieve only the current date use:

=Date()

To retrieve the current date and time use:

=Now()

Just thought I would add that.

Mark

by dbwriter

The problem isn't that the code is wrong. DB's converted from 2.0 display the date correctly. New DB's written in 8.0 or new forms/reports added to converted db's refuse to let me use =Date() at all - but only on some pc's!

by m.r.chambers

Hi, I don't know if this will help at all but I had a similar problem a while ago, with functions that I have used hundreds of times just refusing to work. The way I fixed it was to change the references (as I said, it was a while ago and I can't remember exactly what I did - or even where I went to do it, so you may have to play around a bit to work out what I'm after) I think I had to be in the VBA environment, and they were in Project menu...does that sound right? Anyway, one the references (I think it was a VBA reference was not checked when it should have been...for some reason.

That's pretty vague, isn't it? Sorry, hope you can make some sense of it.

M.R.Chambers

by bob sellman

Another possible cause is the installation of Access 97 on some of your user's computers. I would try re-installing Access 97 on one of the computers where the problem is occurring to see if that fixes the problem. I know I've encountered this problem in the past and, if I remember correctly, re-installing Access brought the function back to life.

by dbwriter

I'll give you the points because it made me think of the other options.

I had reinstalled and did a new install on a clean pc. I thought maybe our network installation became corrupt so I removed office altogether and reinstalled with all options from the cd. Then I could at least use =Date() but could not concatenate it with anything else (ie:="Report Date "& Date()).

Installing Access 2.0 after Access 8.0 let me use the concatenated string!!

by trish_sutter

I ran into a similar problem with a number of functions that received errors. Had to reinstall ACCESS '97 with custom options to get all the VBA functions on the particular PC.

Good Luck!

This discussion is closed to new replies.