Date on Double Click (1 Viewer)

Harry Taylor

Registered User.
Local time
Today, 11:35
Joined
Jul 10, 2012
Messages
71
Hi,

I' trying to add todays date to a field on double click.

I've tried the =Now() function, which works, but also gives me the time.

What is the function to show the date without time.

Thanks in advance :)
 

Harry Taylor

Registered User.
Local time
Today, 11:35
Joined
Jul 10, 2012
Messages
71
That's what I thought, but I get a Syntax Error.

1708429430128.png
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:35
Joined
May 21, 2018
Messages
8,529
Me.date = date()
 

Harry Taylor

Registered User.
Local time
Today, 11:35
Joined
Jul 10, 2012
Messages
71
Thanks MajP.
I think this is the source of the problem.

Appreciate your help
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:35
Joined
May 21, 2018
Messages
8,529
Just to make sure. The reserved word issue is a problem, but not the cause of your problem.
In a calculated control you can set the control source to
=Date()
but in vba you have to set it equal to someting.
SomeField_orControlName = Date()

With reserved words when you use them in SQL they have to have [] around them.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:35
Joined
May 7, 2009
Messages
19,243
it is No problem if you both qualify your control and the function:

Me.Date = VBA.Date
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:35
Joined
Sep 21, 2011
Messages
14,301
Plus your syntax was for when you want the Date as a control source?
 

Users who are viewing this thread

Top Bottom