MSFlexGrid Keyword Filtering

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2008
Posts: 28
Reputation: nor_d83 is an unknown quantity at this point 
Solved Threads: 0
nor_d83 nor_d83 is offline Offline
Light Poster

MSFlexGrid Keyword Filtering

 
0
  #1
Mar 5th, 2009
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..
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 28
Reputation: nor_d83 is an unknown quantity at this point 
Solved Threads: 0
nor_d83 nor_d83 is offline Offline
Light Poster

Re: MSFlexGrid Keyword Filtering

 
0
  #2
Mar 12th, 2009
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....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 435 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC