I made a litle program which querries a database, filtering through it by means of several comboboxes. As you probably can see; I am a bit newbie in programming. But still I got the first form working and this made me rather proud.
But here comes the problem. I also whish to use the same comboboxes on a second form to use it for different purposes like adding data to the database and so on. So I tried shaddowing but somehow I didn't get the code right because the compiler keeps on telling me I should shadow the original combobox om my parent form.
Can someone give me a hand please?
Public Class FrmInvoer
Inherits Form1
Shadows Sub CBO1()
End Sub
Private Shadows Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
ComboBox2.Items.Clear()
DeelSysteemCbo.Deelsysteem(Me.ComboBox2)
If ComboBox2.Items.Count = Nothing Then 'foutafhandeling bij leegstand van de querrie
MsgBox(" Er is nog niets bekend in het systeem. U Mag nu iets invullen! ", MsgBoxStyle.Exclamation)
Exit Sub
Else
ComboBox2.SelectedIndex = 0 'opletten: als de querrie leeg is struikelt hij hier over
End If
End Sub
Private Shadows Sub ComboBox2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
ComboBox3.Items.Clear()
StoringenCbo.Storingen(Me.ComboBox3)
If ComboBox3.Items.Count = Nothing Then 'foutafhandeling bij leegstand van de querrie
MsgBox(" Er zijn nog geen storingen bekend. Maak ons deelachtig van uw griefen ", MsgBoxStyle.Exclamation)
CheckBox1.Checked = True
Exit Sub
Else
ComboBox3.SelectedIndex = 0 'opletten: als de querrie leeg is struikelt hij hier over
End If
End Sub
Private Shadows Sub ComboBox3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
OplossingCbo.Oplossing(Me.RichTextBox1)
End Sub
End Class