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..

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....

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.