Results 1 to 8 of 8

Thread: lockcontrol

  1. #1
    Join Date
    Mar 2003
    Posts
    36

    Unhappy Unanswered: lockcontrol

    Hi,

    I have a form on which I want to lock all the controls if a control called invoiced is ticked. Otherwise I wish to be able to edit the form. Any ideas.??

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    me.allowedits = false

    Would that do?

  3. #3
    Join Date
    Mar 2003
    Posts
    36
    maybe. Where would I put it? Does it go on the oncurrent event?

  4. #4
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    Originally posted by nicky w
    maybe. Where would I put it? Does it go on the oncurrent event?
    Place it in the On_Open event of the form. Use the Method john described.


    This locks the entire form.

    If you want to unlocked form , you willl need to trigger the Unlock Methods by placing Form.AllowEdits = True

  5. #5
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    I would put it behind the actual tick box.

    On the afterupdate on the tickbox:

    if me.invoice then me.allowedits = false else me.allowedits = true

    that should only allow changing anything if the tick box is not true.

    John

  6. #6
    Join Date
    Mar 2003
    Posts
    36
    okay Im getting there just one problem. The invoiced tick is on the main form but the order details are on a subform. How do I refer to the subform that i want to lock. I only really know "me!" stuff.

  7. #7
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    It's quite easy to refer to the whole sub-form. The problems start when you need to refer to a specific control on the form.

    To lock the whole sub:

    me.SubFormName.locked = true

    if you need to refer to a field in the sub:

    me.SubformName.Form.FieldName.Locked = true (I think???)

    John

  8. #8
    Join Date
    Mar 2003
    Posts
    36
    Perfect. Thanks all.

    nicky

Posting Permissions

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