How do I make it so ListBox 2 and 3 show specific items based off of what is selected in my ComboBox? - vb.net

I want to make it so ListBox 2 shows the product ID (which doesnt go up on increments) and Listbox 3 to show the price of the product, but it should be based off of what I select in the Insurance Product Combo Box. How do I manage to do that?
I honestly have no clue what to do here because I'm very new to Visual Basic

Related

Find a record based on info selected in two separate combo boxes

I have a form with about 1200 records. I would like to have the user select a value from a combo box and then select a value from a second combo box. I have a button, and when it is clicked I would like the database to find the record that corresponds to what was selected in the combo boxes.
Is there any easy way to do this? Programming is not a skill of mine, so all I could really come up with was going to the macro builder for on click and selecting the SearchForRecord option. And then for the Where Condition I put
[Field1]=[Combo1] and [Field2]=[Combo2] but that does not seem to work. Any help would be appreciated.

Limit Combobox input based on other control on same form

I have a database in access for which I made some forms, which is going pretty well.
I only have one small issue I am running into.
I have this form on which I have several comboboxes, which get their Row source from another table. That is working fine.
But for combobox B I wanted the options limited/filtered based on the selection in combobox A. So I filled the following in the row source of combobox B:
SELECT JOBS.Numbers
FROM JOBS
WHERE CITY = Me.CITY
So there is another combobox on the same before where the CITY is picked.
Now when open combobox B it asks me to fill in the city manually and then it filters/limits the options in the way I want. However, I want this to happen automatically based on the selection in combobox A (on the same form).
I hope you can help me.
Thanks in advance.
I find this feature very useful. For example I have a form where project managers select there name from a combobox(A) then in the next box(B) select their project. B uses the criteria from the first box to only list their projects.
Specifically the project table I pull the list from has an owner field. I use the name entered into A as criteria on the Owner to pull just their projects.
On the combobox query build I input the Owner criteria like this. The query runs then with whatever data is entered into boxA.
Forms![Main]![cboOwner]
On the first combo box "After Update" event add Me.ComboboxB.Requery. That will make combo box B refresh its contents based on the current value of combo box A every time A's value is changed.

Access VBA code for copying information from a combobox and pasting into a textbox on a continuous form

Really need help with this, I have a continuous form with a combo box to choose data, each row has a different criteria and you can choose only certain items per row in the combo box drop down. (As an example I have four rows one is a cap, one is a bottle, one is a label and the last is oil to go in the bottle.)
What I need is when I have chosen something in the combo box drop down I want it to paste into a text box and stay there until another choice on the same row is made...... Currently I can make the information appear in the textbox but then when I move to another row and choose anothe item it over writes anything I have already chosen.
So an example would be I have chosen product 1, it has cap 1, bottle 1, label 1 and oil 1. In the drop down combo box I can choose only bottles to replace bottles caps to replace caps and so on. I want to choose bottle 2 in the combo box on the bottle line (Which changes all the combo boxes) I now want to save that choice in the text box on the bottle row only, then when I choose Label 2 on the label row even though it changes all the combo boxes I don't want it to overwrite the text box for the bottle row. (I'm assuming a criteria that will only change the row of the combo box you are clicking on or something like that)
hope this makes sense to every body (P.S. I don't know how to get a screen shot in here so have tried to explain to the best of my ability)
Many thanks
Justin
You have to bind the textbox to a field in the record.
As long as the textbox is unbound, it doesn't know about a record and will display the same for all records.
I'm making the assumption that you want to be able to map some product to 4 different types of caps, bottles, labels, and oil:
It seems that your problem is in your data table design, not in your comboboxes. You shouldn't need the text field at all. The problem is that your comboboxes are all based on the same table. When you select Bottle2 from one of them, it matches the rest of the comboboxes to that row. So all the others will get Label2, Cap2, etc. because they are in the same row of the table.
Make a products table call it tblProducts. The fields ID (autonumber), product_name, label_FK, cap_FK, Bottle_FK, and oil_FK should be in it. Those FK stand for Foreign key and should be a number type. The product name can be text.
Create the tblLabel, tblCap, etc. with an ID, and a description.
In your relationships you need to map the tblLable.ID to the tblProducts.Label_FK field. Do this for all 4 type. Then you can re-create the form based on the products table. Whatever the form gives you for the way to control the label_FK, cap_FK, etc. fields you can convert it to a combobox by right click -> change to...
Finally, you may need to update the number of columns of the comboboxes in order to see the description also.
EDIT: More lasting information -
Doing some solid research on data table design will pay huge dividends in design time. Starting with the Database Design Basics page from Microsoft will help as a decent 30 minute intro and should help clear some things up for you.

In Access, how can I make it so values in a ComboBox are hidden, but show up as matches in the combo box's search box?

In my database, I have a table of "Suppliers" and they have a field called Active.
In a form in MS-Access 2010, I have a bunch of fields and I have a Combo Box for selecting Suppliers. However, I would like the Suppliers who are not active to be not visible while scrolling through the possible Suppliers, but if they type in the search box a name that matches the supplier, I would like them to become visible or popup as a match.
How can I do this? I am willing to implement VBA. I apologize if I am misunderstanding Combo Boxes.
Edit: Edited the question to make a little more sense.
If you want items of the searchlist to show up as you type they MUST be in the list.
However, you can sort the list so that the inactive ones appear at the end.
SELECT Supplier, Active FROM tblSuppliers ORDER BY Active, Supplier

vb 2012 how do I make independent listboxes from data records?

Very new to visual studio 2012.
I'm trying to select labour in the top listbox and the excavator in the bottom listbox. When I select the bottom listbox as excavator, the top listbox changes to the excavator as well. How do I make these independent?? The listboxes are looking up a data table where each resource/selection is a row/record. I only want to look up the resource record and not modify the record and the user inputs the quantity manually.
It seems you are binding the same object as source to these two list boxes.
If your DataTable name is dt, use dt.AsEnumerable() as DataSource to each of your list box.