943,955 Members | Top Members by Rank

Ad:
Mar 19th, 2009
0

Plz fix my msflexgrid search codes

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Light Poster
nor_d83 is offline Offline
28 posts
since Aug 2008
Mar 21st, 2009
0

Re: Plz fix my msflexgrid search codes

Ops... Actually it's because of my own mistake.. I have put 'kategori', a field that is not in the data1 itself. Haha!
Reputation Points: 10
Solved Threads: 0
Light Poster
nor_d83 is offline Offline
28 posts
since Aug 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

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: how I pass text directly in data report
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: System beep not loud!





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


Follow us on Twitter


© 2011 DaniWeb® LLC