Folks: this is a very small part of my code.. i have 2 comboboxes filled with RAM values(integers). by using the "nothing" keyword i just want to make sure that both the combo boxes have some values filled in them..

say i choose 1 from combobox1 and 2 from combobox2.. i hit click.. i get the required result..

but if i left the value on combobox2 as it is and changed combobox1's value to 0.5, i get the msg "please enter 2 values".. how can i tell the program that..when 2 values are there..go ahead..and execute..! ???

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

Dim con As OleDbConnection = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=\\rde-fileserve\CAD\Copy of USERS for RAM.mdb")

Dim cmd1 As New OleDbCommand

con.Open()

If (ComboBox6.SelectedItem = Nothing) Or (ComboBox7.SelectedItem = Nothing) Then

MsgBox(" Please choose 2 values")

Exit Sub

how about saying Combobox6.text = vbnullstring instead.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.