Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Posts
    27

    Unanswered: Subform Code to Change Visibility on main form

    Hi there

    I have a query running on a subform of a main form. Basically, when the a field on the subform reads 1, I don't want to display two buttons on the main form. When the field is more than 1, I want the two buttons on the main form to be displayed.

    This is the code I have at the moment:

    Private Sub Form_Current()
    If Me.CountOfCDID = 1 Then
    Command69.Visible = False
    Command70.Visible = False
    Else
    Command69.Visible = True
    Command70.Visible = True

    End If

    End Sub

    How do I change this, to refer to the main form??

    Thanks in advance.
    Ad

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    forms!myformname.mycontrolname.visible = avalue
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2008
    Posts
    27
    thanks so much healdem!!

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    And NAME YOUR OBJECTS!!!! ^^

    Command69

    Sounds like something interesting... can we play guessing games as to what this command ... initiates?

    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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