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

SetValue Getdate()

Status
Not open for further replies.

alniagara

Programmer
Oct 12, 2006
3
GB
Hi I'm building a SQL Server 2000 database with an Access 2003.adp front end and I need a simple way to set todays date in a field when the user requires it.

In Access MDB the expression is Now(), in SQL it's GETDATE() so have tried both in the following macro.

SetValue - ContactDate - =Getdate()

Field Name: ContactDate

On the form I have set the macro to activate on a double click. But it wont run.

Strangley if I set it to return Date() I get a response of 30/12/1899 00:04:29 no matter when I double click the field I always get that response.

Thanks for your help in advance

Al
 
The date you are getting returned is that for a value of 0.

I don't use macros but you could try Date(Now()) or Date(Today) - sorry, but can't remember which works where off the top of my head.
 
Hi,

Thanks but tried both and Access returns the error that it can't parse either of the expressions
Set Value - ContactDate - Date(Now()) or
Set Value - ContactDate - Date(Today())

Can anyone help with an alternative way of doing this?
 
Try setting the expression to: Format(Now(),"Long Date")

or whatever variation you want on that - with the item set to whatever the field is called.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top