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!

ACCESS 97 syntax help SOS

Status
Not open for further replies.
Dec 9, 2003
8
US
Simple question. What is the syntax for system date and time in Access 97? In Access 2000, they're Date() and Time(), right? but didn't work in Access 97.
 
actually, just in the Access form. like data date, i want to show the current date automatically.
 
Yes, they're Date() and Time(). Worked fine in my Access 97. What exactly are you doing?
 
in Form, there is a field called "data date", i want to show the current date as default value. SO in property, i set Date() as default value of this field, it worked in Access 2000, didn't work in Access 97. i got error message.

please help. Thanks a lot.
 
Maybe the syntax for setting default values is slightly different. Use the expression builder; that should generate the syntax you need.
 
Date() gives the current date (on the computer)
Time() gives the current time
Now() gives the current date and time

They work for me in Access97 by putting one of them in the Default Value property of a text box on a form.

Access has some quirks that will sometimes cause things to work one time and not another for no apparent reason. Luckily, there are usually a couple of different ways to do thing and they don't usually all fail . . .

If
Date()

doesn't work, try
=Date()

If that doesn't work put the following code in the Form_BeforeInsert event
txtDataDate = Date()

If all three fail to work, get a Mountain Dew, a (large) pack of M&M's, and 2 Hershey's bars. Eat them all, wait 15 minutes, and let the Beavis in you try to figure it out . . . _________
Rott Paws

...It's not a bug. It's an undocumented feature.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top