Forums
This topic is locked
MS access and auto update Date
13 Nov 2001 10:42:43 jon badda posted:
Is there any way in Access 2000 for the date to be automatically updated when a product field has been changed? currently i have the =Now() expression, but this doesnt change
when I, for example, update the price.
any help?
Replies
Replied 13 Nov 2001 11:30:14
13 Nov 2001 11:30:14 Owen Eastwick replied:
Set the DataType of the field to Date Time but don't provide a default value.
Then create a hidden field on your insert record and update record pages with a value of <% = Date()%> or <% = Now() %>, whichever you prefer and insert that into the Date field.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Then create a hidden field on your insert record and update record pages with a value of <% = Date()%> or <% = Now() %>, whichever you prefer and insert that into the Date field.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 15 Nov 2001 11:29:04
15 Nov 2001 11:29:04 jon badda replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Set the DataType of the field to Date Time but don't provide a default value.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Is it possible to keep the =Now() in the database as well as having the hidden value?
Or will this cause problems further down the track ..
Set the DataType of the field to Date Time but don't provide a default value.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Is it possible to keep the =Now() in the database as well as having the hidden value?
Or will this cause problems further down the track ..
Replied 15 Nov 2001 13:48:42
15 Nov 2001 13:48:42 Owen Eastwick replied:
Nothing stopping you having a default value of Now() in a field which is then overwritten with a date value from an update page. Just make sure the formats match up properly. e.g. if your default format in the database is dd/mm/yyyy hh:mm:ss then make sure that the date inserted by the update page is in the same format.
Why not have two Date fields in the Database, one set with a default value of Now() which would give you a record creation date and another inserted from the page which could provide you with a last updated date.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Why not have two Date fields in the Database, one set with a default value of Now() which would give you a record creation date and another inserted from the page which could provide you with a last updated date.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo