4 Replies Latest reply on Apr 25, 2013 5:35 AM by Steven Smith

    TextBox that groups ComboBox data.

    Steven Smith

      Hi Guys, & Girls.

      I have a basic userform that allows the textbox to combine and display the values in the first 2 ComboBox's together.

      I'm looking for some help, when populating the 3rd and 4th ComboBox's, I would like it to override the data in the texbox.

       

      I'm thinking along the lines on If xxxx = False Then xxxx but im too inexperienced to string it all together.

        • Re: TextBox that groups ComboBox data.
          Steven Smith

          It helps if i load the correct macro. sorry.

            • Re: TextBox that groups ComboBox data.
              Gabriel Lorenzo Yangzon

              Hi,

               

              I cant open your macro I annalyzed your question

               

              just a try

               

              I used C#

               

              if ((comboBox3.Items !=null) ||  (comboBox4.Items != null))
                          {
                              textBox1.Clear();

               

                              foreach (string val in comboBox3.Items)
                              {
                                  textBox1.Text += val;
                              }

                              foreach (string val in comboBox4.Items)
                              {
                                  textBox1.Text += val;
                              }
                          }

               

              b.png

               

              combobox3 value = abcd

              combobox4 value = efgh

               

               

               

              edit: I opened your macro I fixed it tell me if its wrong thanks

               

               

               

               

              Regards,

              Gabriel

              • Re: TextBox that groups ComboBox data.
                Artem Taturevych

                Excuse me I do not completely understand what you are looking for. Do you want to fill the text box when you select some values in comboboxes? If so you need to handle the ComboBox3_Change/ ComboBox4_Change events and set the value for the textbox via ::Text property.

                ____________________________________________________

                Regards,

                Artem Taturevych, Application Engineer at Intercad (Australia)

                 

                LinkedIn SolidWorks API Education Group

              • Re: TextBox that groups ComboBox data.
                Steven Smith

                Hi Gabriel, the updated macro you attached is what i was looking for, thank you. There is alot more as to what I require, but this will give me a starter for what I need.

                I generally, just need a push in the correct direction.

                 

                Hi Artem, Thats exactly what im looking to achieve, what you have suggested.

                The selected values in the 1st set of combobox's will populate the textbox, and when I look to populate the second set of combobox's they would overwrite the values in the textbox with the new data.

                 

                Basically, when we look to do a revision change we would like to select the revision number and a document level letter.

                the text box is used to show the current combination and will be pulled into the drawing sheet.

                 

                Hope this makes more sense.

                Cheers.