×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SetValue Getdate()

SetValue Getdate()

SetValue Getdate()

(OP)
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

RE: SetValue Getdate()

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.  

RE: SetValue Getdate()

(OP)
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?

RE: SetValue Getdate()

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.

RE: SetValue Getdate()

(OP)
Excellent! Works like a dream!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close