Plz fix my msflexgrid search codes

Thread Solved

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

Plz fix my msflexgrid search codes

 
0
  #1
Mar 19th, 2009
Hello everybody.. I have tried to use these codes that I got from a book. I'm using MSFlexGrid, with the Grd name. It was set to be invisible (false visible). And when i enter the year (tahun) needed in the "txttahun" textbox, it will only show the data that related data.

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, Tahun, ID, Kategori, Status, Jumlah_lulus, Nama FROM permohonan"
  5. Data1.Refresh
  6. Grd.Visible = True
  7. End If
  8. If optbyyear.Value = True And txttahun.Text = "2009" Then
  9. Data1.RecordSource = "SELECT Hari, Bulan, Tahun, ID, Kategori, Status, Jumlah_lulus, Nama FROM permohonan where Tahun = " & " '" & txttahun & "'"
  10. Data1.Refresh
  11. Grd.Visible = True
  12. txtAlatulis09.Visible = True
  13. End If
  14. If optbyyear.Value = True And txttahun.Text = "2010" Then
  15. Data1.RecordSource = "SELECT Hari, Bulan, Tahun, ID, Kategori, Status, Jumlah_lulus, Nama FROM permohonan where Tahun = " & " '" & txttahun & "'"
  16. Data1.Refresh
  17. Grd.Visible = True
  18. txtAlatulis10.Visible = True
  19. End If
  20. End Sub

But, my problem is, when i tried to run it, it dispalys "Error run-time 3061, too few parametes, expected 1." and it debugged at "Data1.Refresh" part of codes. Could anybody here plz correct it, or tell me what i need to do.
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: Plz fix my msflexgrid search codes

 
0
  #2
Mar 21st, 2009
Ops... Actually it's because of my own mistake.. I have put 'kategori', a field that is not in the data1 itself. Haha!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC