Results 1 to 4 of 4
  1. #1
    vt800c is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    23

    Question Disabling and Enabling subforms

    I have a 'Welcome' screen that is modal,so that users can't "hurt" themselves when using the application. The welcone screen has a large tab control which contains a single subform under each tab. These were created as separate forms and then dragged and dropped into the tab control. There is a button on each subform that will 'enable' the editing of a record, or to allow creating a new record. The code is a call that sets "Thisform"(Defined as Screen.ActiveForm) AllowEdits, AllowAdditions and AllowDeletions properties to 'True".



    This works fine when each form is opened individually. But when I go through the 'Welcome' form, it doesn't work. I think it's because "Thisform" ends up being the welcome form.

    If I try to enable the tab control using the Me!PgeName.enable (when the default value for me!pgeName is disabled), the button is also disabled and the thing just looks at me.

    The reason behind this approach is so a user can be restricted from adding a new record by hiding an 'add record' button, and prevented from editing a record by hiding an 'Edit' button for each subform (one per tab)

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    If I understand your post; I think that you did identify your solution.

    If these are indeed subforms - then your property manipulation needs the subform syntax if the control is on the main form, rather than the subform. ie:
    Me.SubformObjectName.Properties.AllowAdditions=Tru e

    (actually I'm having a momentary brain freeze and am not 100% sure of that syntax so please check it.....)

    On the otherhand if the control/button is indeed on the subform - then it should work....if it doesn't then possible the editability properties of the mainform are at False and over ride the subform property settings - - not 100% sure of this either - just a consideration for the moment...

    Let me know if you find the fix.

  3. #3
    vt800c is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    23
    We're getting close. it has to do with how to set a form-level property on a subform. I am being greedy, and writing an 'IF-THEN' loop that if I'm NOT on the "Welcome' form I will change the properties of the form. Thats working fine.

    But if I AM on the 'Welcome' form, I'm trying to change the 'form-level' properties of AllowEdits, AllowAdditions and AllowDeletions of the subform. That part is not working so hot.

  4. #4
    vt800c is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    23
    ok..learning as we go along here. I found out that the value I move in to test for a users privileges is occuring too late, as I am doing it on the Mainform, and not the sub-form I guess I will need to do it as part of the initial login. but I think that is do-able.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Enabling Disabling Combo Boxes from Values
    By vdanelia in forum Forms
    Replies: 3
    Last Post: 02-04-2011, 10:09 AM
  2. Replies: 2
    Last Post: 01-15-2011, 10:56 AM
  3. Disabling a control
    By NOTLguy in forum Forms
    Replies: 5
    Last Post: 10-31-2010, 11:34 AM
  4. Disabling A Button
    By cksm4 in forum Programming
    Replies: 8
    Last Post: 10-05-2010, 02:07 PM
  5. Enabling a control and moving to a new tab in vba
    By MuskokaMad in forum Programming
    Replies: 1
    Last Post: 03-14-2010, 05:30 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums