Locking Fields in an Editable Form

  • Thread starter AHizon via AccessMonster.com
  • Start date
A

AHizon via AccessMonster.com

Hello,

I created a form that has the Allow Edits selected as Yes. But I only want 2
fields in the form to be editable, the remaining other fields I'd like them
to be locked. Is there a way I can lock the other fields so that it's not
changed? When I try to change the field property for Locked as Yes, it locks
the field so that when I enter any new records it will not allow me to input
data in that field. Can anyone suggest how I can modifiy my existing form so
that it locks most of the fields after it's saved but allows edits to
specific fields when going back on a record?

Thanks,
Abigail
 
P

Pieter Wijnen

You can turn off & on the locked property in the current event

Private Sub Form_Current()
Me.Ctl1.Locked = Not Me.NewRecord
'...
End Sub

HtH

Pieter
 
G

Guest

If you're using a bound form, in the ON CURRRENT event, use VBA code to lock
the desired fields. Add a command button users have to click to add a new
record, and in the ON CLICK event for that command, include the code to
UNlock the fields.

Problem solved.
 

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