Lock Records in a Table

K

Karl

Hello,
I have a form with two subforms that employees use to mark down there time
sheets. The main form the employee choses the date, the first subform they
chose their name and the third subform they enter their time worked.

In the end I have a table with all the hours worked on each project by the
employee.

However, after the end of the month billing is complete I would like to lock
these records so they don't get accidently get changed when entering future
data. Is this possible and what approach do you recommend.

Thanks,
 
S

Scott McDaniel

Hello,
I have a form with two subforms that employees use to mark down there time
sheets. The main form the employee choses the date, the first subform they
chose their name and the third subform they enter their time worked.

In the end I have a table with all the hours worked on each project by the
employee.

However, after the end of the month billing is complete I would like to lock
these records so they don't get accidently get changed when entering future
data. Is this possible and what approach do you recommend.

You can add a Yes/No field to your tables (bPosted or something), and mark that field as Yes when the item has been
processed. Then, as the user moves through the records, you can use the form's Current event to check this value and act
according:

Sub Form _Current()
Me.AllowEdits = Not Me.bPosted
Me.AllowDeletions = Not Me.bPosted
End Sub

this would effectively "lock" each record as the user moves into it ...

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

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