Form and subform with dropdown lists

Solved
Chris95 -  
G6KCC Posted messages 3 Status Member -
Hello everyone,
I am unable to find the criteria that would allow me to select a name in a form with multiple fields in the sub-form, both being drop-down lists.
For example: Producers and products.
I select a producer and I want to know what products they have across several columns and rows. Everything is on the same table.
Thank you for helping me, I am looking on the forum but I haven't found anything that I can adapt since I'm not very good, not only with Access but also not much better with computers.

Chris.

Configuration: Windows 7 / Internet Explorer 9.0

20 answers

  1. tessel75
     
    Good evening,
    there's no point in excessively underestimating yourself.
    It will be much more useful to clearly formulate your question, because even with the best intentions, the average reader won't understand much.
    Explain what you have: such and such a form with such and such sub-forms, built in such and such a way, with such a request, linked by such a parent field and such a child field. And what you want to achieve without being able to do so.
    Best wishes. Kind regards.
    0
  2. Chris95
     
    I have a form named Form F. It contains a dropdown list of producers' names that start with F (via a grouping query).
    On this same form, I placed another form with all the products created by all the F producers (using a query).
    I wanted a producer selected from the dropdown to "select" only what they produced.
    I can't link the parent-child fields; the response is: it's impossible to link independent forms.
    Thank you tessel75 for your help.
    0
  3. tessel75
     
    Re
    It would be necessary for the forms to be linked as form/sub-form. To be honest, it's not mandatory but much more convenient. Also, have you created two forms with one being the sub-form of the other?
    0
    1. G6KCC Posted messages 3 Status Member
       
      How do we do that?
      0
  4. Chris95
     
    Yes, I have created two forms.
    There is one form and the sub-form is above it. One is the sub-form of the other. The first is the form with the names of the producers. The products are in the sub-form.
    The two forms are independent, which prevents them from being linked.
    0
  5. Chris95
     
    I don't know how to do it any other way.
    0
  6. tessel75
     
    Alright, everything needs to be redone.
    1) Remove the second table without throwing it away, of course.
    2) Check that they have a common Index
    2) In front of your "main" Form, the one containing the suppliers, in the "Creation" ribbon / "Controls" section, select the Sub-Form/Sub-Report Icon by clicking on it
    3) Move the pointer to the location where you want to place your Sub-Form (the pointer represents the top left corner) and click at that spot to place it
    4) A window will appear asking you to designate the parent and child fields. Once both choices are made, click OK
    5) Normally, that's it.
    0
    1. tessel75
       
      After 2) I forgot a line:
      2b) select the form we want to place as a sub-form.
      0
  7. Chris95
     
    Where do I check if they have a common index?
    I don't think they do because when I perform the requested operation I still can't link the fields.
    0
  8. tessel75
     
    Well, we need to start with that or nothing is possible.
    Anyway, when I say "Common Index," I'm talking about the content, not the name, which is irrelevant. You need to be able to link the two underlying tables (or source tables). At the same time, I don't understand how you can connect each supplier's "catalog" to its supplier if they don't have a common index.
    I'll let you create your "Common Index," and I'll check back tomorrow hoping you've succeeded. You also have the method left.
    Good luck.
    0
  9. able.
     
    Everything is in the same table. It's with queries on this table that I created the forms.
    I had indeed correctly selected and set the products form as a sub-form/sub-report. When the window opens, the wizard asks me to choose what I want to enter in the sub-form/sub-report. So I choose the products form and I still can't link the fields.
    I will therefore redo a table only with the products.
    I'll keep you updated.
    Thank you for your patience.
    0
  10. tessel75
     
    Hello,
    I believe that before creating Forms / Sub-Forms, you need to revisit the design of the Databases themselves; otherwise, you'll waste time and energy.
    I advise you to take an hour to thoroughly examine the problem and the solutions, and you will go faster afterward.

    http://www.commentcamarche.net/forum/affich-1700830-exemple-base-de-donnees-access-de-gestion#q=base+de+donn%E9es&cur=2&url=%2F
    0
  11. able.
     
    I summarize: I created a new table called Products.
    I linked the 2 tables (Producers and Products) by a common field.
    On the form, I have a dropdown list with the names of the producers. This list comes from a grouping query created with the producers table.
    In this creation mode form, I place a subform made as you told me before, which is created with the products table.
    I still cannot display the parent-child fields, and in response, it is indicated that they are independent fields.
    0
  12. tessel75
     
    Send the base via cjoint.com
    I'll take a look at that.
    Take care.
    0
  13. Abla95 Posted messages 6 Registration date   Status Member Last intervention  
     
    tessel75, I sent the database via cjoint.com
    link: cjoint.com/?0BjpTgTGaJS
    I don't know if it's what I was supposed to do.
    Thank you for your patience and availability.
    0
  14. Abla95 Posted messages 6 Registration date   Status Member Last intervention  
     
    Following the advice of tessel75, I started again from the tables, queries, and forms.
    When I create a form with a dropdown list, it appears as independent. To make it dependent on a sub-form, you need to select the field titled independent, open its property sheet, select Data, and in its control source, validate the title that is proposed.
    It then becomes dependent on the sub-form.
    0
    1. Abla95 Posted messages 6 Registration date   Status Member Last intervention  
       
      Resolved
      0
    2. ManonM.Ge Posted messages 3 Status Member
       
      I don't understand how you did it... Do you look in the property sheet of the tables to make them dependent?
      0
  15. Abla95 Posted messages 6 Registration date   Status Member Last intervention  
     
    RESOLVED
    0
  16. tessel75
     
    Good evening,
    I am still working on it, but it's taking a bit long because I started over and recreated the tables and queries in particular. I still need to redo the forms. I believe they can still serve as templates for you.
    See you later.
    0
  17. Abla95 Posted messages 6 Registration date   Status Member Last intervention  
     
    You don't give up. I'm lucky.
    It's certain that I'm going to work with what you've done.
    Best regards.
    0
  18. tessel75
     
    Good evening,

    http://cjoint.com/?3BnaopSGKDh

    Above is the result of what I am proposing to you. It's not perfect for the simple reason that I was used to the older versions of Access, 98 and 2000, and this is the first time I'm working on pure creation in 2010. However, the fundamentals remain the same.
    You can see how I constructed 2 main tables for producers and products, which allows you to save space by avoiding duplicating producer records. By planning links between tables, you greatly simplify your task. By going to Tools/DatabaseTools/Relationships, you can see how the links are constituted and understand how they can be useful.
    By looking at the 2 queries, R_Producteurs and R_Produits, especially the second one, you will see the use of these links and how to reconstruct a readable table.
    Lastly, I included a form with its subform that allows you to select a producer and have all the products associated with them displayed below. By positioning yourself on one of the fields of the subform and right-clicking and selecting the contextual menu from form to datasheet view and vice versa, you can more easily see the records attached to the main record.
    This is in response to your initial request.
    Now it’s your turn. Best of luck.
    0
  19. Abla95 Posted messages 6 Registration date   Status Member Last intervention  
     
    Hello Tessel75,
    This is professional work.
    Everything is working. I will continue the following by making the queries and forms in the same way. The "cutting" of the initial table with the links clarifies the database.
    A big THANK YOU for all this work.
    0