Broblem locking posts

mickelingon

Registered User.
Local time
Today, 11:00
Joined
Feb 3, 2006
Messages
72
Hi

I have a patient journal db.
By law you have to be able to "sign out" the textboxes and checkboxes so they not can be edited.
How do I lock the the fields?
I've tried a code found on the forum locking specified field, but I have multiple fields and there will be a lot of hands on specifiing them all.
And another problem is that when I used this code and was going to create another post for a nother patient the field was still locked.

This may sound a little confusing, but I hope you get the picture.

Thanks for all help in advance

Mikael
 
thats crazy when you thing about it.

i can see where they are coming from - you need to not be able to edit/change notes after they were originally written

but if you have developed and are using your own database, you can edit the underlying tables, and put anything in there you want.

In a proprietary system, the developer could prevent you doing this, but as the designer of your own system, you cant prevent yourself doing whatever you want

other than that, you can control what your users can NORMALLY do via the noraml interface - eg, i often use memo fields which store notes, annotated by who and when created them, and display them in a non-editable text box. I provide a mechanism to let new notes be added to the existing notes. A memo is better than a text, as it store 60000 chars - text is only 255

there are two flags on a field called enabled and locked

they work together as follows

enabled true - locked false -normal editable control
enabled true - locked true -control can be entered (eg for searching), but not edited
enabled false - locked true -control cannot be used interactively - just displayed
enabled false - locked false -control contents are "greyed"

enabled true - locked true -control can be entered (eg for searching), but not edited
 
I'm not sure, but from some of his original post I suspect there will be persons other than the developer entering data. Obviously, someone has to have administrative rights so that they can go in and correct errors.

If the users are going to create a new record, fill out all the fields then save the record, all in one sitting, then doing all of this is easy:

Code:
Private Sub Form_Current()
If Me.NewRecord Then
  YourTextBox.Locked = False
  YourCheckBox.Locked = False
Else
  YourTextBox.Locked = True
  YourCheckBox.Locked = True
End If
End Sub
However, if they will ever create a new record, fill out some the fields then save the record, then go back later and fill in other fields, this creates a big problem with the checkboxes. You can still do this for textboxes because if a textbox holds data, you simply lock:

Code:
Private Sub Form_Current()
If IsNull(Me.YourTextBox) Then
  YourTextBox.Locked = False
Else
  YourTextBox.Locked = True
End If
End Sub

If a checkbox has been checked, you know that a chocie has been made to check it, and you can lock it, but what if the checkbox is unchecked? Is it unchecked because the user wanted to leave it unchecked or is it unchecked because the user doesn't know whether they want to leave it unchecked or checked, and want to return to the record later and decide? This is where the problem lies.

Linq
 

Users who are viewing this thread

Back
Top Bottom