Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    3

    Unanswered: Form - Default View

    At least I think this is about the Default View...Here's the scoop:

    I have three tables: ProjectMain, ProjectContacts and Contacts. The ProjectContacts contains two fields: ProjectID and ContactID. I have a relationship built between ProjectMain and ProjectContacts and between ProjectContacts and Contacts.

    From the ProjectMain form I want to open the Contacts form and display the all the Contacts for the Project. I have the Where clause of the OpenForm method set up like this:

    "ContactID IN (Select ContactID from ProjectContacts Where ProjectContacts.ContactID = " & Me.ProjectID & ")"

    When I use this in an SQL Statement like:
    Select Contact.Name from Contacts
    Where ContactID IN (Select ContactID from ProjectContacts Where ProjectContacts.ContactID = 2)

    The SQL returns all the names for the project. When I try and open the form with the Default View set to Continuous Form, only one appears. Is there a way to get all the names to appear on a single form ?

    BTW, it worked properly when I had the ProjectID in the Contacts table and just had to join the two tables, but that doesn't work for my data requirements.

    THANKS !

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    "ContactID IN (Select ContactID from ProjectContacts Where ProjectContacts.ContactID = " & Me.ProjectID & ")"

    This seems wrong. You're asking for ContactIDs that are the same as the ProjectID.

    Try this:

    "ContactID IN (Select ContactID from ProjectContacts Where ProjectContacts.ProjectID = " & Me.ProjectID & ")"
    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
  •