Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New records in filtered group (97/2000)

    This is a basic problem I have had before and solved by myself - but today it has me completely stumped no matter how much I pore over forms I have done it on before!
    Here is the problem:
    I have a form. The data source for the form is a query which includes three joined tables: T_People, T_ContactDetails, and T_ContactTypes.
    The form header contains a combobox which has a list of names. When a name is selected, the records are filtered for contacts with that person.
    When I then add a new contact, I want it to be linked to that person - in other words, I want the field[[T_ContactDetails]. [PeopleID] to equal Me![FindPerson].
    The fields are both comboboxes - and each contains two columns - one invisible column whichcontains the PeopleID (the field which links the two tables T_People and T_Contact Details), and onecolumn that shows and contains the people's names.
    What simple detail am I missing here? Thanks for any tips.
    -cynthia

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: New records in filtered group (97/2000)

    Tell me, what is the relationship between T_People and T_ContactDetails, is it a one (T_People) to many (T_ContactDetails)?

    What is the relationship of T_ContactTypes to the other two tables?

    It seems to me you should have a Main form (based upon T_People) and a subform(s) for T_ContactDetails and T_ContactTypes.
    HTH
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: New records in filtered group (97/2000)

    Make the default value of the combobox on the form equal to a reference to the combobox in the header. I'm assuming the combobox in the header is not bound to the a field in the underlying table, right? A new record then should automatically pick up the value in the header combobox.
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New records in filtered group (97/2000)

    T_people is one-to-many with T_ContactDetails, and T_ContactTypes is one-to-many with T_ContactDetails
    I have done this before without a subform (I have a form where you use a combobox to choose a program, and then it filters for all the people who have participated in that program - that is a completely separate database for an unrelated project) and its been working fine for many months.
    I use subforms a lot, but didn't want to use them on this form. Maybe I don't know enough of the flexibility of subforms, but I was trying to avoid them becuase I don't know how to get the space they occupy on the main form to grow and shrink for more or less records, and also I want some buttons and subforms seem to work better in a datasheet format, and that does not allow for buttons)

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New records in filtered group (97/2000)

    Well! I am quite sure that I tried that earlier today - but I must have done something wrong in the reference. After reading your note, I decided to try it again before just replying that I tried it and it didn't work - but VOILA! It seems to work just fine now. Thanks so much. If it still works in the morning when I add more records, I'll be golden!
    (I'm still baffled about how I got that other form to work - there is NOTHING in the default value property on that one. It's a mystery. But I made that one almost two years ago).

    Thanks again,
    -cynthia

Posting Permissions

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