Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21341

HELP CODE: Search All Category

$
0
0
Hello =) i'm Mark from Philippines
My program has a 6 field names via Access Database

Problem: I wanted to have a Search box which can search 2 field name data. My current code has the ability to search for only 1 field.

Private Sub Form_Load() Code:
  1. Me.Top = (Screen.Height - Me.Height) / 2
  2. Me.Left = (Screen.Width - Me.Width) / 2
  3. Listview.LabelEdit = lvwManual
  4. Listview.FullRowSelect = True
  5. Listview.GridLines = True
  6. Listview.View = lvwReport
  7. cboCategory.Clear
  8. cboCategory.AddItem "ID Owner"
  9. cboCategory.AddItem "All"
  10. cboCategory.ListIndex = 0
  11. Call RefreshListview
  12. End Sub
Private Sub cmdSearch_Click() Code:
  1. On Error GoTo errorsearch
  2. If cboCategory.ListIndex = 0 Then
  3. FindRecordset "Select * From Finder"
  4. Call refreshDataSearch
  5. Else
  6. FindRecordset "Select * From Finder Where Owner like '%" & txtSearch.Text & "%';"
  7. Call refreshDataSearch
  8. End If
  9. Exit Sub:
  10. errorsearch:
  11. MsgBox Error.Description, vbCritical, "Error"
  12. Set FindCon = Nothing
  13. Set FindRs = Nothing
  14. End
  15. End Sub

Hope you guys the best =)

Viewing all articles
Browse latest Browse all 21341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>