search button coding in vb.net

hope this might help u a bit!

Private Sub COORIGIN_COMBO_Click()
COORIGIN_COMBO.DropDown
End Sub


Private Sub VT_COMBO_CLICK()
VT_COMBO.DropDown
End Sub

Private Sub CMD_SEARCH_Click()
'to allow the search button to match criteria with that available in DB
'Sheets("India").Select

'Check if user left it blank
If Me.VT_COMBO.Value = "" Then
MsgBox "Please select the SURNAME", vbExclamation
Me.VT_COMBO.SetFocus
Exit Sub
End If

'Check if user left it blank
If Me.COORIGIN_COMBO.Value = "" Then
MsgBox "Please select the Country of Origin", vbExclamation
Me.COORIGIN_COMBO.SetFocus
Exit Sub
End If


'if criteria matches the following then open the particular spreadsheet
If VT_COMBO.Value = "Singh" And COORIGIN_COMBO.Value = "INDIA" Then
Sheets("INDIA").Select
End If

If VT_COMBO.Value = "LIM" And COORIGIN_COMBO.Value = "CHINA" Then
Sheets("CHINA").Select
End If


Unload Me
End Sub

commented: use code tags -1
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.