Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Surrey, UK
    Provided Answers: 2

    Red face Unanswered: Subforms not displaying or opening in main forms

    Hi all

    I'm designing a database for a colleague, and I've hit a new problem. The database is designed to show user access to one of the core systems. I've created two unbound forms that each have two subforms. On the first, one subform is visible from opening and the other is hidden. On the other, both are initially hidden.

    The problem is that the visible subform is just displaying as white box, very much like what you see in design mode. This is annoying as the user is supposed to select one or more values from the forms's combo box (under different circumstances, I would have used a list box, but there are over 500 choices - therefore, the subform just has one control, and code behind that control automatically prevents duplicates from being selected), and these values are then used to derive the access groups that include them and display them in the other subform. With nothing visible in the first subform, there is nothing to select!

    The second form has two combo boxes which allow the user to select an environment code (hard-coded into the form) and an access group code (dynamically derived from the total list of access groups, restricted to those in the selected environment). When the selection is made in the second combo box, I've written code to:
    • Create an SQL statement to find the codes that that group can access
    • Change the recordsource of the first subform control to the SQL statement
    • Requery and make visible the subform
    • Repeat the above, this time selecting users who are connected to the access group and displaying them in the second subform

    However, the code is now throwing the following error:
    Run-time error '2467'
    The expression you entered refers to an object that is closed or doesn't exist.
    Given that it was working beautifully on Friday when I assembled it, I'm a little stumped. Any ideas? I can post the code if anyone wants to look at it.

    I just closed the database to use another, and then went back into it. It's now working as it's supposed to!

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    Weird one!! Glad it's resolved
    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