Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2014
    Posts
    22
    Provided Answers: 1

    Unanswered: Help with enabling/disabling form and subform controls

    I will do my best to explain this. I have a number of forms (Most of these, have simple data entry fields). On these forms, when I click a certain button (Edit Record, Save Record, Cancel). I can enable and disable certain controls. That works correctly. I have those forms load with fields disabled. However, I have a form with a subform (with tabs) in it. I want to be able to click a button on the form and effect controls on the subform. Can this be done? If so, help please. Code is below:

    Form: frmSystems
    SubForm: frmSystemsforSub

    Code on Form to Edit Record:
    'System Tab
    ' Me.fldProductShortName.Enabled = True
    ' Me.fldProductLongName.Enabled = True
    ' Me.fldISDCustID.Enabled = True
    ' Me.fldSysDescription.Enabled = True
    ' 'Vendor Information tab
    ' Me.fldVendorShortName.Enabled = True
    ' Me.fldVendorLongName.Enabled = True
    ' Me.fldVendorAddress.Enabled = True
    ' Me.fldVendorCity.Enabled = True
    ' Me.fldVendorState.Enabled = True
    ' Me.fldVendorZip.Enabled = True
    ' Me.fldVendorPhone.Enabled = True
    ' Me.fldVendorWebAddress.Enabled = True
    ' 'Technical Support Tab
    ' Me.fldVendorTechSuppContact.Enabled = True
    ' Me.fldVendorTechSuppEmail.Enabled = True
    ' Me.fldVendorTechSuppPortal.Enabled = True
    ' Me.fldVendorTechSuppPhone.Enabled = True
    ' Me.fldVendorTechSuppPhone.Enabled = True
    ' 'Sales Support Tab
    ' Me.fldVendorSalesContact.Enabled = True
    ' Me.fldVendorSalesContactPhone.Enabled = True
    ' Me.fldVendorSalesContactEmail.Enabled = True
    ' 'Vendor Other Information
    ' Me.fldVendorOIContact.Enabled = True
    ' Me.fldVendorOIAddress.Enabled = True
    ' Me.fldVendorOIPhone.Enabled = True
    ' Me.fldVendorOIEmail.Enabled = True

    I want to be able to click on one of the buttons (Edit, Save, etc.) on the form and have it effect the fields on the Subform.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The syntax to refer to the subform if that's what you're after:

    http://www.mvps.org/access/forms/frm0031.htm

    A couple of other methods:

    http://www.dbforums.com/showthread.p...fields-at-once
    Paul

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Also note that the Subform is actually a Subform Control, and as such, you can only work on a Subform, i.e. edit, add, etc., if the AllowEdits Property on the Main Form is set to Yes/True. Access considers anything done to a Subform to be editing the Main Form.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is 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
  •