i would like to sort the information inputted on the textbox and make it appear on the listview of another form by using the combobox. like if i inputted my Surname, First_Name and Middle_Name and i chose the "Full" item for my paytype with the id number "txtid" and the "yearlevel". they are all inputted using the textbox except for the yearlevel and paytype. they all should appear on the listview of another formand i click the save button, my surname, first name and middle name, txtid and yearlevel will appear on the listview of my full_pay form.

if paytype.text="full" then
'my information will go to the full_pay form
  elseif paytype.text="installment" then
'my information will go to the ins_pay form

hope you can help me

See if this helps.

Public Class Form1
    Private arCmbItems() As String = {"full", "installment"} '// ComboBox.Items.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ComboBox1.Items
            .Add(arCmbItems(0)) : .Add(arCmbItems(1)) '// add .Items.
        End With
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        With ComboBox1
            If Not .SelectedIndex = -1 Then
                Select Case .SelectedItem '// compare.Item w/String Array.
                    Case arCmbItems(0)
                        MsgBox("item 1") '// send selected.Data to other Form's ListView here.
                    Case arCmbItems(1)
                        MsgBox("item 2") '// send selected.Data to other Form's ListView here.
                End Select
            End If
        End With
    End Sub
End Class
Comments
I cannot believe that you were actually able to parse that request.

hi, i tried it but there were few errors that i don't understand. help me please?
in this line the word load is the one with the underline

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

and it says "event 'load' cannot be found"

next is this one

With ComboBox1

the combobox1 is with the underline and "reference to a non-shared member requires an object reference."

and lastly,

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

, combobox1 again "handles clause requires a WithEvents variable defined in the containing type or one of its base types"

i changed the name of my combobox to ComboBox1 and still nothing changed.

Try in new project.
If it works, Then it works and you have to figure out how to insert the posted solution/suggestion into your project, Not.Me; since that was not part of this thread's question. Good luck.:)

This article has been dead for over six months. Start a new discussion instead.