A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

need a form to auto date on table



 
 
Thread Tools Display Modes
  #1  
Old September 16th, 2008, 04:13 PM posted to microsoft.public.access.tablesdbdesign
zippyties
external usenet poster
 
Posts: 1
Default need a form to auto date on table

I have a data base that keeps track of links and the date they were visited
last. I have a date field in my table that I would like to record the date
that the link was clicked.

I tried setting up an auto date in the table, however the form will not
overwrite if the latest date is newer.

How can I get my form that displays the the queried links to put date() into
the appropriate field on the table? This would allow me to filter my queried
results oldest to newest.

Thanks
  #2  
Old September 16th, 2008, 10:44 PM posted to microsoft.public.access.tablesdbdesign
Beetle
external usenet poster
 
Posts: 1,254
Default need a form to auto date on table

In the Before Update event of your form;

Me![YourDateField] = Now()
--
_________

Sean Bailey


"zippyties" wrote:

I have a data base that keeps track of links and the date they were visited
last. I have a date field in my table that I would like to record the date
that the link was clicked.

I tried setting up an auto date in the table, however the form will not
overwrite if the latest date is newer.

How can I get my form that displays the the queried links to put date() into
the appropriate field on the table? This would allow me to filter my queried
results oldest to newest.

Thanks

  #3  
Old September 16th, 2008, 10:53 PM posted to microsoft.public.access.tablesdbdesign
Graham Mandeno
external usenet poster
 
Posts: 593
Default need a form to auto date on table

Hi Zippyties

There is no such thing as an "auto date" field.

You can set the DefaultValue of a date/time field to =Date() or =Now() and
this will ensure that new records that are created in your table have the
current date (and time if you use Now) written into that field.

To update a date/time field in a record that already exists, you must use an
event of a form. For example, it is common to use the form's BeforeUpdate
event to update a field recording when the record was last changed.

For your application, it sounds like you should use the Click event of the
control containing the link:

Private Sub MyLink_Click()
LastVisited = Now()
End Sub

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"zippyties" wrote in message
...
I have a data base that keeps track of links and the date they were visited
last. I have a date field in my table that I would like to record the
date
that the link was clicked.

I tried setting up an auto date in the table, however the form will not
overwrite if the latest date is newer.

How can I get my form that displays the the queried links to put date()
into
the appropriate field on the table? This would allow me to filter my
queried
results oldest to newest.

Thanks



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.