By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,078 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,078 IT Pros & Developers. It's quick & easy.

Record locking

P: n/a
Hi

Having created and implemented a database, I wish to lock (prevent further
changes) a record when the data entry has been completed, by say having a
'completed' check box on the form that locks that particular record,
although new records can continue to be entered and edited (until
'completed').

How might I go about implementing this?

Cheers
Feb 23 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
bsn

"Mark" <ms*********@btinternet.com> skrev
Having created and implemented a database, I wish to lock (prevent further
changes) a record when the data entry has been completed, by say having a
'completed' check box on the form that locks that particular record,
although new records can continue to be entered and edited (until
'completed').

How might I go about implementing this?

U should use the Form BeforeUpdate(maybe ask a question before saving) or
Form AfterUpdate(check box = -1) event...
Bjarne
Feb 23 '06 #2

P: n/a
Assuming that the completed checkbox is bound, create a function in
your form with the following code

Public Function LockRecord()

If me.chkComplete = True Then
me.AllowEdits = False
me.lblStatus.Caption = "Data entry is complete. Edits are locked."
Else
me.AllowEdits = True
me.lblStatus.Caption = "Whatever"
End If

End Function

In the Forms current event and the after update event of the check box
enter:

=LockRecord

You may want to add some code to confirm before locking the edits.

Jason

Feb 23 '06 #3

P: n/a
Assuming that the completed checkbox is bound, create a function in
your form with the following code

Public Function LockRecord()

If me.chkComplete = True Then
me.AllowEdits = False
me.lblStatus.Caption = "Data entry is complete. Edits are locked."
Else
me.AllowEdits = True
me.lblStatus.Caption = "Whatever"
End If

End Function

In the Forms current event and the after update event of the check box
enter:

=LockRecord

You may want to add some code to confirm before locking the edits.

Jason

Feb 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.