Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NOW() and DATE() Problems 1

Status
Not open for further replies.

Kathleen

Instructor
Mar 23, 2000
5
US
We have had numerous problems with these two common expressions. In Access 2000, sometimes they work; sometimes they don't. This happens on several machines in different locations.<br><br>In reports either function may display the #Name? error message. Sometimes when entering the Date() function in an unbound text box with the Expression Builder, absolutely nothing happens so that the control is still blank.<br><br>Any ideas?<br><br>Thanks, Kathleen.
 
I've experienced similar problems with Access 97, actually.<br>Our solution (albeit an odd one) was to copy the database by importing all tables, queries, forms, reports, and macros into a blank database (Do not jsut directly copy the database).&nbsp;&nbsp;&nbsp;This seemed to cure that problem for some reason.&nbsp;&nbsp;We think that it may have had something to do with some code that had been written long, long ago that was being run on startup, but had no actual present function.<br>after copying, everything worked fine, on all computers.<br><br>You may just want to check any code you have, or anything that opens on startup by commenting (use the ' in VB) it out.&nbsp;&nbsp;If your date fields work, then you know that's the problem.<br><br>report back if this does or doesn't work, i'm still curious as to the actual cause of the problem. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
It depends on where you stick the code that determines it's syntax.<br>I alway's format a date period<br>like so<br>Date<br>=format(now,&quot;mm/dd/yy&quot;)<br>Time<br>=format(now,&quot;hh:nn&quot;)&nbsp;&nbsp;&nbsp;&lt;&lt;&lt;&lt; NO that's not a typo cause &quot;m&quot; is a month<br>this works in 90% of all case's<br>In VBA<br>In Access '97 and in Access 2000 <br><br>
 
Kathleen,<br>I think it's a library reference that's missing.&nbsp;&nbsp;check the References (from the vb environment with a module open).&nbsp;&nbsp;I recall this happening to me and it was either Dao36.dll or VBxxx32.dll or something was missing.<br>--Jim
 
Late post ...

We have four computers running the exact same .MDB.

Two cannot recognize the Date() function inside a query. The other two can.

We have checked the references on two computers so far. They both have the same references, except the one with the reference to the Microsoft Object Library 3.51 works and the one with the reference to the Microsoft Object Library 3.6 does not. I'd wait to post the results of further investigation but have to go.

John Wildanger


 
i agree it's reference/library problem. check this for article

faq181-936

 
I had a client whose PC's which referenced the Microsoft DAO 3.6 library did not recognize the Date function, whereas the PC's which referenced the Microsoft DAO 3.51 library did recognize the Date function.

The solution was simple.

For the 3.6 PC's, I did the following:

Brought up a form in Design mode.

Did View-Code. This brought up the Visual Basic editing form.

Went into the Tools-References selection, deselected Microsoft DAO 3.6 and clicked OK.

Went back into the Tools-References selection and (re)selected Microsoft DAO 3.6 and clicked OK.

The PC then recognized the Date function.
 
if you end up with users all over the place and you cannot get to their machines, there is code in the FAQ i mentioned above--i put it in to launch at db opening. it essentially does what you did manually, to make sure everything is checked ok. i dont totally understand references, but i know that this code works, and all the times anyone has ever had a problem they just uncheck and re-check and then it works. good enuf for me :))

g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top