Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   someone plz help me with mh code (http://www.programmingforums.org/showthread.php?t=15519)

shidayati Mar 31st, 2008 1:21 PM

someone plz help me with mh code
 
:

  1. Private Sub Label5_Click()
  2. Dim pegang3 As String
  3. If Option2.Value = True Then
  4.  
  5.  
  6. Set General = db.OpenRecordset("select * from GeneralLog WHERE DATE LIKE '*" & Text2.Text & "*'")
  7.  
  8.   Text2 = Combo2 & "/" & Combo1 & "/" & Combo3
  9. pegang3 = Combo2 & "/" & Combo1 & "/" & Combo3
  10.  
  11. If Text2 <> "" Then
  12.  
  13.  
  14.  
  15.         'Text2 = rsGeneral.Fields!Date
  16.  
  17.         Text2.Text = General.RecordCount
  18.  
  19.         frmadmin.txtDate = pegang3
  20.  
  21.         If General.RecordCount <> 0 Then
  22.             Do While Not General.EOF
  23.                 If General.Fields!Date = Text2.Text Then
  24.                 Call loadLV
  25.                 End If
  26.  
  27.                 General.MoveNext
  28.             Loop
  29.  
  30.  
  31.         Else
  32.             MsgBox ("Record 0")
  33.         End If
  34.     End If
  35. End If
  36.  
  37.  
  38. End Sub







""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
i don't what problems with this code..something with their looping and call funtion not work properly.the result no shown like i want and not appear at listview data.

Freaky Chris Mar 31st, 2008 1:24 PM

Re: someone plz help me with mh code
 
Is this VBA for Access? Plus could you please use code tags.

im afraid i can't offer much help as i do not know what it is supose to look like, if you could provide a bit more info that would be helpful.

Chris

shidayati Mar 31st, 2008 1:40 PM

Re: someone plz help me with mh code
 
:

  1. Private Sub Label5_Click()
  2. Dim pegang3 As String
  3.  
  4. """"user click at radio button for enter daily report
  5. If Option2.Value = True Then
  6.  
  7.  
  8. Set General = db.OpenRecordset("select * from GeneralLog WHERE DATE LIKE '*" & Text2.Text & "*'")
  9.  
  10.   Text2 = Combo2 & "/" & Combo1 & "/" & Combo3
  11. """" combo1 for dare
  12. '''''''combo2 for month
  13. '''''combo3 for year
  14.  
  15. If Text2 <> "" Then
  16.  
  17.  
  18.  
  19.         'Text2 = rsGeneral.Fields!Date
  20.  
  21.         Text2.Text = General.RecordCount
  22.  
  23. '''' check and loop for result
  24.  
  25.         If General.RecordCount <> 0 Then
  26.             Do While Not General.EOF
  27.                 If General.Fields!Date = Text2.Text Then
  28.                 Call loadLV
  29.                 End If
  30.  
  31.                 General.MoveNext
  32.             Loop
  33.  
  34.  
  35.         Else
  36.             MsgBox ("Record 0")
  37.         End If
  38.     End If
  39. End If
  40.  
  41.  
  42. End Sub



''''''''''''''''''''''''''''''''''''
this program is to show daily report for student attendance based on date that enter by teacher......example if 30 student attend class on 28/02/2008..show the result will be shown all names of student.

OpenLoop Mar 31st, 2008 5:34 PM

Re: someone plz help me with mh code
 
Is this the full code? what is loadLV?

shidayati Apr 1st, 2008 7:21 AM

Re: someone plz help me with my code
 
:

  1. ''''call function
  2.  
  3.  
  4. Private Sub loadLV()
  5.  
  6. '''''function in search'''''''''
  7.  
  8. On Error Resume Next
  9. ListView1.ListItems.Clear
  10.  
  11. Do While Not General.EOF
  12. Set items = ListView1.ListItems.Add(, , General.Fields!Log)
  13. 'items.SubItems(1) = rsSTUDENT.Fields!STUDENTNAME
  14. items.SubItems(1) = General.Fields!Date
  15. items.SubItems(2) = General.Fields!ATTENDANCE
  16.  
  17. General.MoveNext
  18. Loop
  19. End Sub



All times are GMT -5. The time now is 4:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC