Form and subform with dropdown lists
Solved
Chris95
-
G6KCC Posted messages 3 Status Member -
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
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
-
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. -
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. -
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? -
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. -
-
-
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. -
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. -
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. -
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. -
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 -
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. -
-
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. -
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. -
-
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. -
You don't give up. I'm lucky.
It's certain that I'm going to work with what you've done.
Best regards. -
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. -
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.