Results 1 to 3 of 3

Thread: EDIT BUTTON

  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Indiana
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    EDIT BUTTON

    I'm real proficient in establishing a locked record, and using an EDIT button on a form to unlock the form for changes. Naturally with the goal of preventing "accidental" mistakes I also include a message box warning the user of permanent changes.

    Question: I have a form that contains a subform. How can I use the EDIT button on the "main" form to also unlock the subform? I have the subform "OnCurrent" and "AfterUpdate" properties established to reset the form to AllowEdits = False. But when I try to code the EDIT button to AllowEdits for both the main and subform, it returns an error stating the subForm cannot be found. I would prefer not to add a second EDIT button on the subform itself (if possible)

    As always, I appreciate the help. <img src=/S/fire.gif border=0 alt=fire width=15 height=15>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: EDIT BUTTON

    The method you use depends on what you actually want to do with the subform. If you have the control locked so that the user can't even enter the subform, then simply set the subform control's locked property to false to allow the user to enter the subform. When you reference the subform in code, you need to reference the actual form, not the control, so the syntax is Me!subformControl.Form.property
    Charlotte

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: EDIT BUTTON

    I wanted to reply to your private message in the thread so that other Loungers can benefit from it.

    In the syntax I described, you have to replace the words in it with the actual objects from your form.

    "Me!subformControl.Form.property" is a general pattern for the syntax. If you're trying to set the AllowEdits property, you would do it like this:

    Me!<the_name_of_your_subform_control>.Form!<the_na me_of_your_combobox>.AllowEdits = True

    If the subform itself is named Orders and the subform control is call subOrders, you have to refer to subOrders instead of the actual underlying subform name. Since you're getting an error stating that the subform can't be found, it follows that you are using the wrong name or the wrong syntax to set its AllowEdits. Why don't you post the exact code you're using to try to use.
    Charlotte

Posting Permissions

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