General discussion

Locked

Ms Access refresh field

By pina ·
how to refesh a field that indicate the latest date when the data was modified on a specific form (record)was done

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by sgt_shultz In reply to Ms Access refresh field

have you tried attaching a refresh macro to the After Change event on each field? or does that take too long? tell us more about exactly how you want this to work

Collapse -

by pina In reply to

Poster rated this answer.

Collapse -

by pina In reply to Ms Access refresh field

yes I have over 100 fields and attaching a macro is a tedious operation, anything faster?

Collapse -

by timfox In reply to Ms Access refresh field

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.

Collapse -

by pina In reply to

Poster rated this answer.

Collapse -

by pina In reply to Ms Access refresh field

This question was closed by the author

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums