Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AllowEdits in subforms on tabcontrols (2000)

    I have a form which contains a tabcontrol.
    The tabcontrol has a number of tabs.
    Some of the tabs have 2 subforms on them.

    I wish to set the allowadditions, allowedits and allowdeletions on the subforms to false when i open the original form, and have a checkbox to set them to true.

    So far I've been struggling with setting the values to false

    I've tried

    ProductTabsRecipeSub.Form.AllowEdits = False
    ProductTabsRecipeSub.Form.AllowAdditions = False
    ProductTabsRecipeSub.Form.AllowDeletions = False

    and

    With me.ProductTabsRecipeSub.Form
    .AllowEdits = False
    .AllowAdditions = False
    .AllowDeletions = False
    endwith

    The above was cribbed from another posting on this site

    but to no avail

    Any ideas? In this example, ProductTabsRecipeSub is a subform in a tabcontrol called ProductTabsControl on a form named ProductTabs

    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AllowEdits in subforms on tabcontrols (2000)

    A subform may not yet be available for manipulation when the main form opens. I would set the Allow Additions etc. properties to No in design view.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AllowEdits in subforms on tabcontrols (2000)

    How can I then switch them back on Hans?
    Is the code I am attempting to use correct?

    john

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AllowEdits in subforms on tabcontrols (2000)

    The code - with False replaced by True - should work to enable additions etc., if you have used the name of the subform as a control on the main form - this is not necessarily the same as the name of the subform in the database window.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AllowEdits in subforms on tabcontrols (2000)

    Hans
    Thanks - it worked as you suggested.
    I know it's sometime not a good idea to ask "why?" but why?
    At what stage is the form available to have all of it's attributes altered?
    Any thought as to why I can set enabled to false for a particular subform but not allow me to set the allowedit option instead at the same point?
    I'm getting my head around things slowly, but sometimes it just smashes into that brick wall
    John

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AllowEdits in subforms on tabcontrols (2000)

    When a form with subforms is opened, there has to be interaction between them to start the synchronization between main form and subforms. I don't know what the exact order of events is. When you disable a subform, you are manipulating the subform as a control, but when you try to set the AllowEdits property, you are manipulating the subform as a form.

Posting Permissions

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