Lock one field in a select querry?

G

Guest

I've looked at the responses regarding locking records, but have one more
specific question. I would like to lock certain fields in a table from
editing, but still be able to add records to that table. Then, I would need
to unlock the table if any entry had to be edited. For instance, I have a
table with 3 fields, a UID, StoreName, and memo field. I don't want any
editing done to the UID or StoreName, but I need to be able to add records.
Editing the memo field is done frequently. Finally, if there is a name
change, I need to be able to unlock the StoreName field and edit the
StoreName, then revert to it being locked. Any suggestions for this two part
dilemma? Thanks.
 
G

Guest

Here is what I got when I asked this question. Solved my problem.

Use the Current event of the form to lock the control if you are not at the
new record:

Private Sub Form_Current()
Me.[NameOfYourControlHere].Locked = Not Me.NewRecord
End Sub
 
G

Guest

In addition to Sarahs reply you should create an option to unlock the
formfield for editing. It could be a button which when pressed should do
something like:

me.storename.locked=false

But if users are not allowed to do this you could place it somewhere else
like on the double click option of the storename...

Maurice
 

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