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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date field in reports - MS insert code doesn't work!

Status
Not open for further replies.

rjmccafferty

IS-IT--Management
Jul 16, 2001
29
US
I am running Access 2000, front end and back end. When I prepare reports I naturally like to include the date. Access has, in the insert drop down, options for inserting page numbers and dates in various formats. The one I prefer for date is the one that Access enters automatically as
=Format(Date(),"Short Date")

But when I use this, instead of getting a date on the report, it prints as #Name?

Thinking it might somehow be like the =count(*) function where it only works in the report header or footer, I tried the date entry in detail, page header and report header, always with the same error message.

That is absolutely baffling since this is code Microsoft preset for use in the program. I have reverted to using =now(), but it is a format I do not care for. I did, of course, trying using the MS code but with Now() instead of date(). That doesn't work either.

Can someone tell me how I need to change the MS code so that it will actually print the date?
 
Goto a code window. Choose tools and refernces. Uncheck any options with Missing in.
Your format function looks ok so there maybe a problem with the date function. Try this and see if it works.

Nick
 
Another suggestion: What is your date field named on your report? If it's name is "Date" then you have a circular reference issue. Try renaming the control to something else. Maq B-)
<insert witty signature here>
 
To Nick: I went to the code window with Tools|References. I do not understand the advice &quot;Uncheck any options with Missing In. There are about 8 to 10 options checked and they look to be pretty standard. Can you give me a different explanation of what I am looking to uncheck?

Maq: The field is named text0.

I notice that =date() does not work. I don't know that it necessarily should work, but since it is part of the expression I am trying to use in the format statement, I thought I would give it a try.

It is just so ridiculous that this is MS's own preloaded code that does not work.
 
OK.

If your Date function is not working then I am almost certain there is a reference problem.

In Tools - References, look at each reference and see what they say. eg. Visual Basic for Applications should be there with a tick next to it. Try unselecting every one and see what happens (you can always select them again if u have to)

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top