943,597 Members | Top Members by Rank

Ad:
Mar 5th, 2009
0

MSFlexGrid Keyword Filtering

Expand Post »
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.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2. Private Sub cmdCalculate_Click()
  3.  
  4. Dim i As Integer
  5. Dim TAmt As Currency
  6.  
  7. TAmt = 0
  8. For i = 1 To Grd.Rows - 1
  9. TAmt = TAmt + Val(Grd.TextMatrix(i, 6))
  10. Next
  11. TAmt = Val(txtBudget09.Text) - TAmt
  12. txtBalance.Text = Format(TAmt, "0.00")
  13.  
  14. End Sub
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub cmdExit_Click()
  2. Data1.UpdateControls
  3. Unload Me
  4. Form7.Show
  5. 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..
Reputation Points: 10
Solved Threads: 0
Light Poster
nor_d83 is offline Offline
28 posts
since Aug 2008
Mar 12th, 2009
0

Re: MSFlexGrid Keyword Filtering

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2. Private Sub cmdPapar_Click()
  3. If optall.Value = True Then
  4. Data1.RecordSource = "SELECT Hari, Bulan, ID, Kategori, Status, Jumlah_lulus, Nama FROM permohonan"
  5. Data1.Refresh
  6. Grd.Visible = True
  7. Else
  8. Data1.RecordSource = "SELECT Hari, Bulan, ID, Kategori, Status, Jumlah_lulus, Nama FROM permohonan where Hari = " & " '" & txtHari & "'"
  9. Data1.Refresh
  10. Grd.Visible = True
  11. End If
  12. End Sub

I've got this, and applied it, and it works! But, could anybody show me, how to do double filtering simultaneously? Plz....
Reputation Points: 10
Solved Threads: 0
Light Poster
nor_d83 is offline Offline
28 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Query date range help pls...
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: need help with my game.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC