Question Parly lock records

wdenboer

Registered User.
Local time
Today, 22:22
Joined
Feb 4, 2009
Messages
14
Hi All,

I am working on a database which will be used for question and answering. Person A raises a question, by filling a form. After finishing his question he will push the save button and the record is saved and the form is emptied and ready for a new question.

Person B will answer the questions using a similar form.
The field on both forms are stored in one table.

The problem is that the persons using the database should not have the ability to unintentionally alter a previously saved record. If they have the intention to change that record, they should click an unlock button of some kind. Because the user forms store in the same table not all cells of a record should be locked.

I hope there is anybody around understanding my question and capable of providing some help.

Kind regards
Wouter
 
If you set the Enabled and Locked properties on the textbox to False and True respectively and only reverse the settings when the user click the edit button. By using the OnCurrent event of the form set the controls according to the contents of the answer textbox.

David
 
Hi David,

First i like to thank you for the fast reply to my problem.

If I understand it correct I should lock all fields on the form. After I click the edit button the locks for certain field will be temporarily removed.
With the on current event I should make check whether a field is filled of not.
Iif(field = null; do nothing; unlock field)

Do I understand it correct?

thanks again
Wouter
 
Yes you are correct:

Form OnCurrent Event

Me.Question.Enabled = IIf(IsNull(Me.Question),True,False)
Me.Question.Locked = IIf(IsNull(Me.Question),False,True)

Me.Answer.Enabled = IIf(IsNull(Me.Answer),True,False)
Me.Answer.Locked = IIf(IsNull(Me.Answer),False,True)
 

Users who are viewing this thread

Back
Top Bottom