Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to prevent data from being changed later....

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I created a timesheet program and it has a form to allow Managers to approve a timesheet. This is done with a yes/no field next to the employee name.
Now, the Managers don't want users to be able to change any records (after they have been approved). Is there a way to lock records somehow? How can I do this?

DougP
 
You can lock them against normal tampering, but even with Access security, you won't have a great deal of safety against malicious tampering. To lock against normal tampering, simply set allow edits to No for the form when the approved flag is true, or set the locked and / or enabled properties of fields.
 
DougP,
My suggestion is to use Access/Jet security. Here you can have a form for users to edit times, which only selects the un-approved records.

Users log in under an account which has *no* access to the timesheet table...*however*, they use a query using the With Owner Access Option, so using that query only they can read and edit unapproved records as if they were the owner (manager-level user).
--Jim
 
One thing I forgot to mention is there are two tables one is the header record which has Name, Date and Approved, the other table has details such as Day of week, Time on job etc. It does not have a Approved field. So when thew form is opened all employee show up in a subform at the top and when click one thereir detials show up ina nother subfrom below it So I guess I need to add another field which I check with code when the the first is checked.

DougP
 
You can set the locked property of the subform control to true in the current event is the approved control is true.

Me.[subform control name].Locked=Nz(Me.chkApproved,False)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top