Hello,
I would like to know how to view details in relation to an item selected from a drop down list.
Thanks for your help
Hello,
I would like to know how to view details in relation to an item selected from a drop down list.
Thanks for your help
Hi Lili, there are different possibilities. I presume the items in your list come from a table. Most combo boxes row sources have two columns: the ID that's hidden (column width = 0) and the description that is shown. You can add several columns to the row source and show these in the drop down list. However, once an item is shown only the content of the first column where column width > 0 will be shown. If you need to show the extra information on the form you can create a few extra unbound columns to your form and set the control source to [name Combobox]!Columns(x) where x is the column number (based on a count from 0) you want to show.
Or you can use the DLookup function as a control source for an unbound text box.
you will need some code, but not enough information provided to provide a specific solution
assuming your combo is called cboCustomers and contains an id to the items listed (such as customerID, customerName) and does not have a value in the controlsource and is the bound column is customerID and you want to view the details in the same form the combo is on and that form has a recordsource of tblCustomers then perhaps in the change event of the combobox would be something like
me.filter="customerID=" & me.cboCustomers
me.filteron=true
so a lot of assumptions about what you might have
Yes sorry i didn’t give a lot of information, the things is I want like that user can double click on the selected item and maybe like a table or a form will pop up with the informations about this selected item.
Thank you
Perhaps you could mock up a sample or show us some real data. Or post a copy of your database with instructions to highlight the issue/opportunity.
Open the table (item_reserved) when you double click on one item in a drop list, so the only item selected will show up with all the information that is in item_reserved table
Hi Lily
If you can upload a zipped copy of your current database so we can look at your tables it would help.
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
Create a form (single or continuous) based on your table, with controls linked to table fields;
Place your combo (unbound) into form header. Add an OnSelection event to combo, which locates the record in form where table field matches with combo's bound column value;
Add an Current event to form, which sets combo bound column equal to matching form field value.
When you make a new selection for your combo (the combo value, i.e. bound value, not value displayed), the matching record is displayed or activated in form. When you select another record in form, the combo displays the value matching with active row of form.
When this isn't what you want, please give a better explanation!
- Create an Unbound Combobox (name it as cboID) with the required Columns of data with the related ID as the first column value on the Header Section of the Main Form.
- Create a Sub-Form separately with the Detail data and don't forget to include the ID Field as well.
- Drag and Drop the Sub-Form on the Detail Section of the Main Form.
- Click on the outer Border of the Sub-Form and display the Property Sheet.
- Set the Link Master Field Property with the value cboID
- Set the Link Child Field Property with the Value ID or whatever the Key field Name in your table but the value should match with the value in the Combobox first column.
- Save the Main Form with the sub-form.
- Open the Main Form and select an item from the Combobox, you will see the related record details appear on the sub-form.
Thank you this is exactly what i want to do. I hunderstand all the step except the first one, why do I need to put the combo list in the header of my form?
- Create an Unbound Combobox (name it as cboID) with the required Columns of data with the related ID as the first column value on the Header Section of the Main Form.
- Create a Sub-Form separately with the Detail data and don't forget to include the ID Field as well.
- Drag and Drop the Sub-Form on the Detail Section of the Main Form.
- Click on the outer Border of the Sub-Form and display the Property Sheet.
- Set the Link Master Field Property with the value cboID
- Set the Link Child Field Property with the Value ID or whatever the Key field Name in your table but the value should match with the value in the Combobox first column.
- Save the Main Form with the sub-form.
- Open the Main Form and select an item from the Combobox, you will see the related record details appear on the sub-form.
Can you give me an example ?
Hi Lily
If you upload a zipped copy of the database we can give you an example
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
You typically put controls for navigation or form filtering in the header or footer because the detail section is reserved for things that change as you move from record to record. If your main form has no recordsource, then there is no 'danger' that anything you place in the detail section is going to move around (unless your form height doesn't fit within the form or application window). It's just common practice though because you don't want such controls scrolling up or down out of view.why do I need to put the combo list in the header of my form?
Last edited by Micron; 06-07-2021 at 11:48 AM. Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Thank you so much everyone it worked !!! 😁