Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2001
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Referring to a subform in VBA (Access 2000)

    How do I refer to a subform in VBA?
    Scenario: The user is opening a form (and subform) and I want to create buttons to toggle from ReadOnly to EditMode.
    TIA

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

    Re: Referring to a subform in VBA (Access 2000)

    Hi Cath,

    If your code runs on the main form, use something like

    Me.SubFormName.Form.AllowEdits = True

    where SubFormName is the name the subform has as a control on the main form. This is not necessarily the same a s the name of the subform in the database window. By appending .Form after the name of the subform, you specify that you refer to the form as opposed to the control.

    BTW, Dev Ashish has a comprehensive overview of Forms: Refer to Form and Subform properties and controls on the Access Web.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2001
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Referring to a subform in VBA (Access 2000)

    Hans
    Thanks muchly! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

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