Tri-State Checkbox in excel VBA - vba

I am developing a macro in Excel VBA and I am not expert. I need to show data in Treeview. In tree view there are only two state for checkbox. Either select or not select. I want to know is there any way(Preferably simple way) to show a third state.
Let say I have 10 children in a node, If user select checkbox for 5 children then parent node should display partial selection state of check box.
It is not needed to be a checkbox any control that show tristate would be fine.
Note: Before I came here I spent more than 5 hours in google. But I am not able find solution that match my need.
Any help will be appreciated.

Related

How to use option buttons to change a value in a Word 2016 table

I am attempting to create a form that uses option buttons to assign a score, which would later be totaled for evaluation purposes. (I am using Word 2016 on Windows 10.)
Here is a pic of a portion of the proposed form, with 5 columns:Proposed Form
Here is a picture of the code I have attempted to use, which worked just exactly as I wanted it to "in EXCEL." Due to needs in other parts of the form, however we will be using Word, not Excel.Code Pic
Since we've decided to use Word, due to other features that Excel lacks, what code should I be using that would place a point value in the "Points" column? (I am assuming e2 to be the address of the 2nd row, 5th column?). I have spent 2 days so far trying to understand how to make this work. I know it can be done, but I lack the specific coding knowledge to make it happen. Thanks in advance for your help!
You appear to be using both formfields and ActiveX controls. It would be far simpler to use just formfields and, instead of having radio buttons, a simple dropdown for each item. That way, you don't need all those separate columns and the results could be tallied from the dropdown selections without the need for VBA.

Repopulating an already populated dropdown list in SSRS report

I need assistance with something which I have not been able to find through searching this site or even via Google.
I currently have an SSRS report which has a dropdown list that is immediately populated upon loading of the page.
Due to the extensiveness of this list, I have been asked to add another paramater to the report - a text box that would allow the user input and further "filter" the already-populated dropdown list.
By adding this feature, it would allow the user to narrow the contents of the dropdown list, if the user already knows what value he/she is after.
Now this is where I'm getting stuck... as far as I am aware, you can only have one dataset that is able to provide the data of any given paramater (in this case, a dropdown list). So how do you repopulate a dropdown list, that has already been populated?
Any assistance with this would be greatly appreciated.
EDIT: Please note that the only code driving this report are SQL stored procedures. This report was created using Visual Studio 2013.
Thanks.
Use a second dataset in order to populate your dropdown. In the second dataset, simply take your sql query and select distinct in a group, then you can use the second dataset as the dropdown and tie it to your column that matches.

VB DataGridView click event to variables

Where I want the code to go and what the window looks like.
I am creating an application which helps you select the components you want in your computer build. It pulls the components name and price from a database I have created in Access.
I want the user to be able to double click on one of the items in the DataGrid (FullRowSelect) it will update this screen (interface isn't completed) with the name and price of the component once it has been selected.
What I need is for someone to tell me how I am meant to put the Name and Price of the selected component into the two variables. I've tried a few different ways but none of them worked correctly.
Thank you for any help :)
Found out a solution to my problem. A single line of code.
componentName = tableGPU.Rows(e.RowIndex).Cells(0).Value

vb.net combobox data changes

I am making my final year VB.NET project, I am using Visual Studio 2008 with 3.5 framework
I am making a Restaurant Bill generation software.
I have created the table in SQL and connected to the project, I added 6 combo boxes with drop down,
I have assigned drop-downs as the Menu item of the restaurant, when I run the program and try to change one combo box item, all combo box items get changed. How can I avoid this?
How to get rid of this?
I am not a professional in this, but any help will be appreciated
I would guess that you've bound them all to exactly the same BindingSource (which is pointing at the same data), in which case changing the selection in one combobox will immediately be reflected in the others. If you have multiple items bound to the same BindingSource (which is what the wizard will give you if you're not careful), and don't want a change in one to reflect in the others, you need to create separate BindingSources for each one.

limit selections in a listbox in vb.net

I am creating a web control in vb.net that contains a list box. I know that I am able to choose a selection mode of Single or Multiple, but I am interested in limiting a Multiple selection to a predetermined size. For example preventing a user from selecting more than 3 items.
I have tried adding a Validator to the list box, which might be a way forward, but was wondering if there was a way of changing the selection mode to something a bit different than just the two specified ones.
Any ideas or suggestions would be greatly appreciated
Edit: Unfortunately due to project limitations I am unable to use Javascript on this problem. very annoying I know!
You could try handling one of the SelectedIndexChange events. With multiple selection, each time this event fires you can check how many items have already been selected. If it is more than you want, have the handler deselect the one that was just selected. You could also put up a little red label under the listbox saying "Sorry, no more than [n] selections allowed."
EDIT:
Just noticed you said WEB. Same theory applies, but it would have to be done using Javascript.
On the SelectedIndexChanged event, write a short piece of code that will check the number of selected items and if it is greater than your desired amount, unselect the new selection (or unselect the oldest one, or however you wish this to operate).