Results 1 to 8 of 8

Thread: student violation monitoring

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    student violation monitoring

    how to compute the number of violations per student and per date and gives warning and turn into offenses. Please help me about my system

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: student violation monitoring

    What have you tried so far?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    Re: student violation monitoring

    Here's the code:

    vb Code:
    1. Private Sub lvButtons_H2_Click()
    2. Err.Clear
    3.  
    4. If txtstudentidno.Text = "" Or _
    5. txtlastname.Text = "" Or txtfirstname.Text = "" Or txtmi.Text = "" Or txtcourse.Text = "" Or txtsection.Text = "" Or _
    6. cboViolation.Text = "" Then
    7.  
    8. MsgBox "Please Fill All The Fields", vbInformation, "Fill All the Fields"
    9.  
    10. Exit Sub
    11. Else
    12.  
    13. Set conn = New ADODB.Connection
    14. conn.Open ConnectString
    15. sql = "SELECT * FROM STUDENTVIOLATION"
    16. Set rs = New ADODB.Recordset
    17. rs.Open sql, conn, adOpenStatic, adLockOptimistic
    18.     With rs
    19.         .AddNew
    20.         !StudNo = txtstudentidno.Text
    21.         !LastName = txtlastname.Text
    22.         !FirstName = txtfirstname.Text
    23.         !Mi = txtmi.Text
    24.         !course = txtcourse.Text
    25.         !section = txtsection.Text
    26.         !ViolationDesc = cboViolation.Text
    27.         !Date = Label6.Caption
    28.         !Time = Label3.Caption
    29.         .Update
    30.  
    31.  
    32. End With
    33. conn.Close
    34. Set conn = Nothing
    35. Set conn = New ADODB.Connection
    36. conn.Open ConnectString
    37. Dim StudNo As String
    38. Dim Violation As String
    39. StudNo = txtstudentidno.Text
    40. Violation = cboViolation.Text
    41. sql = "select * from studentviolation where studentviolation.StudNo ='" & Trim$(StudNo) & "' And studentviolation.ViolationDesc ='" & Violation & "' Order By StudNo='" & Trim$(txtstudentidno.Text) & "'"
    42.     Set rs = New ADODB.Recordset
    43.     rs.Open sql, conn, adOpenForwardOnly, adLockReadOnly
    44.     StudNo = rs.RecordCount
    45.     rs.Filter = "StudNo ='" & rs!StudNo & "'"
    46.         vio = vio + 1
    47.         If vio = 1 Then
    48.         Form1.Label3.Caption = "This is First Violation"
    49.         Form1.Label2.Caption = "Report to the SSO"
    50.         Form1.Show
    51.         Set conn = New ADODB.Connection
    52.         conn.Open ConnectString
    53.         sql = "select concat (student.LastName, ', ', student.FirstName, ' ', student.Mi, '. ') as StudName from student"
    54.         Set rs = New ADODB.Recordset
    55.         rs.Open sql, conn
    56.         End If
    57.         If vio = 2 Then
    58.         Form1.Label3.Caption = "This is Second Violation"
    59.         Form1.Label2.Caption = "Report to the SSO"
    60.         Form1.Show
    61.         Set conn = New ADODB.Connection
    62.         conn.Open ConnectString
    63.         sql = "select concat (student.LastName, ', ', student.FirstName, ' ', student.Mi, '. ') as StudName from student"
    64.         Set rs = New ADODB.Recordset
    65.         rs.Open sql, conn
    66.         End If
    67.         If vio = 3 Then
    68.         Form1.Label3.Caption = "This is Third Violation"
    69.         Form1.Label2.Caption = "Report to the SSO"
    70.         Form1.Show
    71.         Set conn = New ADODB.Connection
    72.         conn.Open ConnectString
    73.         sql = "select concat (student.LastName, ', ', student.FirstName, ' ', student.Mi, '. ') as StudName from student"
    74.         Set rs = New ADODB.Recordset
    75.         rs.Open sql, conn
    76.         End If
    77.  
    78.         If vio = 4 Then
    79.                 frmMain.Label5.Caption = "Warning!!!"
    80.                 frmMain.Label5.Visible = True
    81.                 frmMain.Label5.Enabled = True
    82.                 End If
    83.         If vio = 5 Then
    84.                 Form5.Show
    85.                 frmOffenses.txtstudentidno.Text = rs!StudNo
    86.                 frmOffenses.txtlastname.Text = rs!LastName
    87.                 frmOffenses.txtfirstname.Text = rs!FirstName
    88.                 frmOffenses.txtmi.Text = rs!Mi
    89.                 frmOffenses.txtcourse.Text = rs!course
    90.                 frmOffenses.txtsection.Text = rs!section
    91.                 Call GetOffenseInfo
    92.                 frmMain.Label5.Caption = ""
    93.                 frmMain.Label5.Visible = False
    94.                 frmMain.Label5.Enabled = False
    95.                 txtstudentidno.Text = ""
    96.         End If
    97.         Form1.Label2.Caption = "Report to the SSO"
    98.         Form1.Show
    99.         txtstudentidno.Text = ""
    100.         txtlastname.Text = ""
    101.         txtfirstname.Text = ""
    102.         txtmi.Text = ""
    103.         txtcourse.Text = ""
    104.         txtsection.Text = ""
    105.         Image2.Visible = False
    106.         Image1.Visible = True
    107.     conn.Close
    108. End If
    109.  
    110. End Sub
    Last edited by si_the_geek; Oct 16th, 2011 at 05:02 AM. Reason: added Code tags

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: student violation monitoring

    Could you please wrap your code in [highlight="vb"][/highlight] tags so it is easier for forum members too read. Thank you! Although, I don't think you have the ability to edit your posts being a new user so I will tell a staff member to do it.

    Edit:

    What is vio? You need to define it as string, etc (whatever type it is suppose to be). Also it doesn't appear that you initialize vio anywhere? Why not save vio in the database too?
    Last edited by Nightwalker83; Oct 16th, 2011 at 04:48 AM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    Re: student violation monitoring

    how?

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: student violation monitoring

    Quote Originally Posted by briandon View Post
    how?
    How to save it in the database?

    Edit:

    In answer to my question check the Database Development FAQ.
    Last edited by Nightwalker83; Oct 16th, 2011 at 05:18 AM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    Re: student violation monitoring

    yes, saving into database

  8. #8
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: student violation monitoring

    I edited my previous post! Check the link I posted.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width