Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Relationships (97)

    I always struggle with relationships between tables and getting forms to create the correct realtionship from a combo box. Is there a website that can explain from basics onwards what is needed in each table and why, then how to use forms to create the relationship.

    Thanks,

    Simon

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

    Re: Relationships (97)

    You have me totally confused. <img src=/S/confused.gif border=0 alt=confused width=15 height=20> What do forms and comboboxes have to do with relationships?

    Relationships exist between tables and are a permanent part of your database design, so why would you create a relationship from a form when you have a graphical interface for that already in the Relationships window?

    Are you talking about the temporary relationships created in the query grid? Perhaps if you explain your purpose, someone can give you better advice.
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Relationships (97)

    Okay, clearly did not explain myself very well. I understand the need to have a relational database. I think I understand the relationships window, however someparts do puzzle me such as enforce referential integrity.

    What I want to do is create the relationship between two items using a combo box on a form. Is this unreasonable or wrong. When I enter the details of an item on the input form I would like a combo box that contains the options for which record to show the relationship with.

    I am not looking for solutioneering (yet). I would like advice where to find information that can provide explanations. Any offers?

    Thank you for taking the time to read this.

    Simon

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Relationships (97)

    What you are proposing to do is possible in theory - you can establish relationships using VBA, and you could use some combo boxes on an unbound form to chose the tables and fields that establish the relationship. However it would be a very complex exercise, and would more or less duplicate the function already performed in the relationships window. However,

    <font color=blue><<When I enter the details of an item on the input form I would like a combo box that contains the options for which record to show the relationship with.>></font color=blue>

    things don't really work this way. Relationships don't exists between records, they exist between tables. On the other hand, if what you want to do is show the records in one table that are linked to a single record in another table, that is most commonly done in Access with a subform. Combo boxes are most typically used to provide a lookup capability in the other direction, so that you can see the one record in a table that many records in another table are linked to. In general they are used to provide a lookup capability so that only certain entries can be made in a given field, and in many cases save space in a table by using a number to point to a text string. In addition, they provide quick data entry by letting you typing only enough characters to find a unique value.

    Hope this helps clarify things a bit, but I suspect you will need a more extensive explanation. I don't really know of any tutorial sites on the web that will give you what you are looking for - you might however check out Microsoft's MSDN site and this article. Books are probably a better bet, though you may have some challenges finding 97 books - most will be either 2000 or 2002. The concepts haven't changed dramatically, but the examples they give may not work in 97. A good library might be one possibility - another might be a local user group.
    Wendell

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

    Re: Relationships (97)

    If all you want to do is use a combobox to insert a foreign key value from another table, that is simple. However, it is not creating a relationship, merely inserting the key that relates two particular records. Is that what you're trying to do? If so, what is your specific question? Do you need to know how to populate the combobox or what? The combobox wizard will help you create a combobox to lookup values in a table. If the control is bound to a field in the form's underlying recordset, making a selection will automatically insert the linking key. Are you trying to do something else?
    Charlotte

Posting Permissions

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