How do you know if a user had viewed a record? VBA? Access Trigg

W

Webtechie

Hello,

I have a form that is built on a table. The table has about 200 records.
The user that will modify the data is also doing other tasks.

She will work on some and then stop. Then she will come back to the form
and work on some more.

I've been asked to show a flag of some sort that indicates that this record
has already been modified.

Now I'm thinking I could create a status field. When the record is
modified, I could update the status. If this were SQL, I would put a trigger
on the table and then know what record was modified.

Any of those with more experience than me can think of a way to show the
user that this record has already been modified, go to the next record.

I have to keep all the records in the table until the user has finished all
the records and then I export them to a flat file.

Thanks.
 
J

John W. Vinson

Now I'm thinking I could create a status field. When the record is
modified, I could update the status. If this were SQL, I would put a trigger
on the table and then know what record was modified.

You can do the same thing in VBA using the Form's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
<do any record validation first>
Me!Status = "Updated"
End Sub
 
D

David H

You don't have too many options.

You could add a LastModifiedDateTime field which is automatically updated to
Now() via the forms Before_Update event. However, this assumes that the user
actually modified the record. If the user only viewed the record on the form,
without taking any action, or viewed the record via a query or directly in
the table, there's no way to capture that. You could use the Form's OnCurrent
event to update the field, however there's no way of knowing that the user
actually reviewed the information or just displayed it and moved on to
another record.

You could go with an approach that uses a status field as you mentioned and
then require the user to take some action indicating that they've reviewed
the record. I would probably go with a drop down box with whatever status
codes you come up with 'Pending', 'Approved', etc. That would allow you to go
one step further and used Conditional Formating to show the status of the
records.
 
W

Webtechie

John,

Thanks for the idea. I may use that on other requests.

David,

Excellent idea. That, man, is exactly what I am going to do.

Thanks so much!!

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top