Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MS Access Duplicates

Options
  • 23-06-2008 9:59am
    #1
    Closed Accounts Posts: 30


    Hi,

    I'm having difficulties listing all duplicate values of a database (in a subform). The Main form contains a dropdown box, listing all organisations (with the duplicates removed). The subform 'should' display all the revelevant personnel (contact info) in that organisation in a datasheet format, but will only list on value.

    How can I retrieve all the contact details for each person within the organisation in the subform?

    Thank you,

    :confused:


Comments

  • Registered Users Posts: 15,065 ✭✭✭✭Malice


    ncarroll wrote: »
    Hi,

    I'm having difficulties listing all duplicate values of a database (in a subform). The Main form contains a dropdown box, listing all organisations (with the duplicates removed). The subform 'should' display all the revelevant personnel (contact info) in that organisation in a datasheet format, but will only list on value.

    How can I retrieve all the contact details for each person within the organisation in the subform?

    Thank you,

    :confused:
    What does your SQL query look like at the moment?


  • Closed Accounts Posts: 30 ncarroll


    Attached is a screen shot of the form. I the use to use dropdown box, select an organiastion, and access will display all contact detaails on datasheet (subform).

    query:

    SELECT Title, [Name 2], Name1, Position, Phone, [Phone 2], [Phone 3], Email
    FROM Organisation, contacts
    WHERE Organisation=Forms!cboMyComboBox.Text And organisation.ID=contacts.ID;

    Problem is that it opens textbox (.text); getting correct result though, but want it to work on select of dropdown item.

    How do I call this query, i.e. macro or row source, or........?

    :o


  • Closed Accounts Posts: 94 ✭✭Done and dusted


    So you want the select query to be based on the drop down selection yeah?


  • Registered Users Posts: 15,065 ✭✭✭✭Malice


    Can you do Forms!cboMyComboBox.Value or Forms!cboMyComboBox.Item? Sorry, I don't have any experience with Access forms so that's just a guess.


  • Closed Accounts Posts: 94 ✭✭Done and dusted


    malice_ wrote: »
    Can you do Forms!cboMyComboBox.Value or Forms!cboMyComboBox.Item? Sorry, I don't have any experience with Access forms so that's just a guess.

    yeah thats what i was thinking but I wasnt sure if the value in the dropdown he wants i.e. to be in the select statement.


  • Advertisement
  • Closed Accounts Posts: 30 ncarroll


    Thanks for your help guys....

    but..


    Still can't get this - it must be some simple ,mistake. Attached is a shot of what I'm getting back - so annoying :mad: When I manually type in the Company nam,e, it opens a different table with all relevant details (Contact Details - name, phone, email, etc) of all the people in the organisation.


  • Closed Accounts Posts: 94 ✭✭Done and dusted


    can you post the code for this app, well the relavent section? wait...you did.

    eh try this

    WHERE Organisation=Forms!cboMyComboBox.Value

    set a breakpoint on this line and then check the value of Forms!cboMyComboBox.Value to see if it contains the actual value from the combo box


  • Moderators Posts: 51,799 ✭✭✭✭Delirium


    ncarroll wrote: »
    Attached is a screen shot of the form. I the use to use dropdown box, select an organiastion, and access will display all contact detaails on datasheet (subform).

    query:

    SELECT Title, [Name 2], Name1, Position, Phone, [Phone 2], [Phone 3], Email
    FROM Organisation, contacts
    WHERE Organisation=Forms!cboMyComboBox.Text And organisation.ID=contacts.ID;

    Problem is that it opens textbox (.text); getting correct result though, but want it to work on select of dropdown item.

    How do I call this query, i.e. macro or row source, or........?

    :o


    Try the following:
    SELECT Title, [Name 2], Name1, Position, Phone, [Phone 2], [Phone 3], Email
    FROM Organisation, contacts
    WHERE Organisation=Forms!MyForm.cboMyComboBox And organisation.ID=contacts.ID;
    

    On properties for the cboMyComboBox make sure the bound column is set to the appropriate column.

    Hope this helps.

    If you can read this, you're too close!



Advertisement