954,157 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MSFlexGrid Keyword Filtering

Hello everybody.. I have a form in my project, that's having a Grd name MSFlexGrid and a Data1. Besides, it also have a cmdCalculate and cmdExit button. Their codes are below.

Private Sub cmdCalculate_Click()

Dim i As Integer
Dim TAmt As Currency

      TAmt = 0
      For i = 1 To Grd.Rows - 1
         TAmt = TAmt + Val(Grd.TextMatrix(i, 6))
      Next
      TAmt = Val(txtBudget09.Text) - TAmt
      txtBalance.Text = Format(TAmt, "0.00")
           
End Sub
Private Sub cmdExit_Click()
Data1.UpdateControls
Unload Me
Form7.Show
End Sub


Above are only my descriptions of my form. My real problem is, I need to do some filtering to the Data1 shown in MSFlexGrid (Grd namely), so that it only shows the data of keyword that i need. For example, the keyword "Medical". Do i need to add a Combo1 on the form, and some codings? Could u Geeks plz give me the codes? Plz help me..

nor_d83
Light Poster
28 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 
Private Sub cmdPapar_Click()
If optall.Value = True Then
Data1.RecordSource = "SELECT Hari, Bulan, ID, Kategori, Status, Jumlah_lulus, Nama FROM permohonan"
Data1.Refresh
Grd.Visible = True
Else
Data1.RecordSource = "SELECT Hari, Bulan, ID, Kategori, Status, Jumlah_lulus, Nama FROM permohonan where Hari = " & " '" & txtHari & "'"
Data1.Refresh
Grd.Visible = True
End If
End Sub


I've got this, and applied it, and it works! But, could anybody show me, how to do double filtering simultaneously? Plz....

nor_d83
Light Poster
28 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You