Sabtu, 27 Desember 2014

Re: [MS_AccessPros] Today's Date

 

thanks, Graham ~

and taking it one step further, put
=Now()
in the DefaultValue property of the field in the table design

I used that an as example without thinking!  then no need for the form to do anything ~

usually one tests for NewRecord to disregard 'new' and only create a value when a record being edited.  You can, however, use the field's DefaultValue in the table design to create values when a record is created ~

Warm Regards,
Crystal

Enforce Referential Integrity (RI) on Access Relationships (cc)
https://www.youtube.com/watch?v=_zxxc9jzWEg
- importance of referential integrity, how to fix data when RI can't be enforced

~ have an awesome day ~


On Saturday, December 27, 2014 4:47 PM, "'Graham Mandeno' graham@mandeno.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:


Hello Kambiz



Set the DefaultValue property of your textbox to =Now().



If you just want today's date, without the time, then use =Date() instead.



Good luck and Happy New Year!

Graham

  _____ 




Graham Mandeno
Microsoft Access MVP 1996 - 2014





Graham



From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Sunday, 28 December 2014 08:43
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Today's Date



 

Thank you Crystal,
What I like to do is when end user add a new record date and time be
automatically "Now()" enter into its field and would not change if record is
edited.
1. As you instructed I used:
If Me.NewRecord Then
Today = Now()
End If
it did not work, please help with code.

2. The field in question should be Date/Time or Text field?

I remain as always
Kambiz





[Non-text portions of this message have been removed]



------------------------------------
Posted by: "Graham Mandeno" <graham@mandeno.com>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/join
    (Yahoo! ID required)

<*> To change settings via email:
    MS_Access_Professionals-digest@yahoogroups.com
    MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/



__._,_.___

Posted by: Crystal <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

.

__,_._,___

Tidak ada komentar:

Posting Komentar