6 replies
by sgt_shultz
by pina
Poster rated this answer.
by pina
by timfox
Let's say that your form (and probably the underlying record, as well) has a field called txtLastUpdatedDate where you want to display the last updated data value.
--> What
Decide when you want to update the value
1. Each time a value is changed on the form
2. Each time a field value is modified
3. Each time the form is closed
4. Each time the record is saved
-->When
For each choice, you are choosing a different event to put your next bit of code in, as follows:
1. Each time a value is changed on the form
- OnChange
2. Each time a field value is modified
- AfterUpdate
3. Each time the form is closed
- OnClose
4. Each time the record is saved
- Depends on implementation, but whenever you actually perform the save operation.
-->How
If you are storing a LastUpdateDate value against the recordset and if you are binding the fields directly to the datasource, then do this:
txtLastUpdatedDate = Now()
...and let Access actually put the value into the record, per normal record saving.
If you are saving the data to the database record directly, then within your With recordset bundle, use:
!LastUpdateDate = Now()
Notes
1. On loading the form, upload the field as you would populate the other fields.
2. Use 'Date()' instead of 'Now()' if you just want the date without the time value.
by pina
Poster rated this answer.
by pina
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending