dcsimg
Results 1 to 4 of 4

Thread: Combo Box contents into a text box field

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2016
    Posts
    16

    Combo Box contents into a text box field

    Hi all

    I have 3 combo boxes that users select data, i want to pass the selected data to a text box, as this text box then encodes to a bar code,

    I can manually type in the text box and the bar code works, I just need to pass the data from the combo boxes to the text boxes.

    Is this the correct way to do it or am i way of the mark.

    Thanks in advance
    Ant

  2. #2
    Fanatic Member kpmc's Avatar
    Join Date
    Sep 2017
    Posts
    1,013

    Re: Combo Box contents into a text box field

    Do you want this value 'passed' only when there is a selection made in all 3 boxs?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2016
    Posts
    16

    Re: Combo Box contents into a text box field

    yes or can be a button to pass the 3 selections many thanks

  4. #4
    Fanatic Member kpmc's Avatar
    Join Date
    Sep 2017
    Posts
    1,013

    Re: Combo Box contents into a text box field

    There are many ways you could get there. This example assumes DropStyle of DropDown where the user can type a value, but will handle the selected dropdown text change also
    Code:
        Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.TextChanged,
                                                                                             ComboBox2.TextChanged,
                                                                                             ComboBox3.TextChanged
            If Not String.IsNullOrEmpty(ComboBox1.Text) AndAlso
               Not String.IsNullOrEmpty(ComboBox2.Text) AndAlso
               Not String.IsNullOrEmpty(ComboBox3.Text) Then
                TextBox1.Text = ComboBox1.Text & ComboBox2.Text & ComboBox3.Text
            Else
                TextBox1.Clear()
            End If
        End Sub
    you could modify this into a button click easy enough

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width