Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2015

    Unanswered: Locking cells in a form

    I want to be able to lock a particular cell in a field inside a form using a code. I tried after_update event procedure and set it to lock but the whole field was locked that I cant even input anything unless I unlock. Pls help. Thanks

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    you've got several issues

    one to lock once a change is made... the form after update event may be a smart call
    one to set the lock state when the current record changes (on current event)
    ..get to grips with what events fire and when. note there is no guarantee that all events will neccesarily fire as Access can remove certain events if in its structure it decides the queue is too long

    one to work out how to unlock... is that based on a person, on a password?

    to set an effective lock state use the enabled property.

    bear in mind that this locking behaviour will only affect that control in that form. the data could be changed in:-
    another form, which doesn't have the same code,
    by a query run elsewhere (in another form, a report, a macro and so on)
    by direct user entry if you are (I was going to say foolish enough allowing users to view data using a datasheet view
    by actions from another Access application (another Access application if it connects tot he data can make changes
    by actions in another program altogether (eg in a .NET or a web or any other program) that has access to the data
    you may be able to defeat some or all of this using a trigger and probably a stored procedure to authenticate changes
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Quote Originally Posted by chyckooo View Post
    ...lock a particular cell in a field inside a form...set it to lock but the whole field was locked
    The items in red are confusing! What, exactly, do you mean when you say lock a particular cell? Cell is actually an Excel term, and has no meaning in MS Access.

    Your explanation sounds as if you're trying to only lock part of a Field, rather than the entire Field.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts