The document contains code for a student course registration system. It includes subroutines to print documents, clear form fields, calculate total credit hours based on checked courses, and display messages for valid and invalid credit hour totals.
The document contains code for a student course registration system. It includes subroutines to print documents, clear form fields, calculate total credit hours based on checked courses, and display messages for valid and invalid credit hour totals.
The document contains code for a student course registration system. It includes subroutines to print documents, clear form fields, calculate total credit hours based on checked courses, and display messages for valid and invalid credit hour totals.
CommonDialog2.CancelError = True CommonDialog2.ShowPrinter MsgBox "Printing", vbInformation, "Printer" Exit Sub CancelCheck: End Sub Private Sub Command3_Click() txtTotal.Text = "" Combo1.Text = "Please Select Your Semester" txtName.Text = "" txtMatricNo.Text = "" Check1.Value = 0 Check2.Value = 0 Check3.Value = 0 Check4.Value = 0 Check5.Value = 0 Check6.Value = 0 Check7.Value = 0 Check8.Value = 0 Check9.Value = 0 End Sub Private Sub Command2_Click() If Check1.Value = 1 Then credithours = credithours + 3 End If If Check2.Value = 1 Then credithours = credithours + 3 End If If Check3.Value = 1 Then credithours = credithours + 3 End If If Check4.Value = 1 Then credithours = credithours + 3 End If If Check5.Value = 1 Then credithours = credithours + 3 End If If Check6.Value = 1 Then credithours = credithours + 3 End If If Check7.Value = 1 Then credithours = credithours + 3 End If If Check8.Value = 1 Then credithours = credithours + 3 End If If Check9.Value = 1 Then credithours = credithours + 3 End If txtTotal.Text = credithours If credithours > 21 Then MsgBox "Your chosen courses are more than 21 credit hours", vbCritical, "Attention" txtTotal.Text = "" Check1.Value = 0 Check2.Value = 0 Check3.Value = 0 Check4.Value = 0 Check5.Value = 0 Check6.Value = 0 Check7.Value = 0 Check8.Value = 0 Check9.Value = 0 End If If credithours < 21 Then MsgBox "Your chosen courses are less than 21 credit hours", vbCritical, "Attention" End If If credithours = 21 Then MsgBox "Congratulation! You have successfully registered the courses. Welcome to UUM!", vbDefaultButton1, "Congratulation!" End If End Sub Private Sub Command2_Click() If Check1.Value = 1 Then credithours = credithours + 3 End If If Check2.Value = 1 Then credithours = credithours + 3 End If If Check3.Value = 1 Then credithours = credithours + 3 End If If Check4.Value = 1 Then credithours = credithours + 3 End If If Check5.Value = 1 Then credithours = credithours + 3 End If If Check6.Value = 1 Then credithours = credithours + 3 End If If Check7.Value = 1 Then credithours = credithours + 3 End If If Check8.Value = 1 Then credithours = credithours + 3 End If If Check9.Value = 1 Then credithours = credithours + 3 End If txtTotal.Text = credithours If credithours > 21 Then MsgBox "Your chosen courses are more than 21 credit hours", vbCritical, "Attention" txtTotal.Text = "" Check1.Value = 0 Check2.Value = 0 Check3.Value = 0 Check4.Value = 0 Check5.Value = 0 Check6.Value = 0 Check7.Value = 0 Check8.Value = 0 Check9.Value = 0 End If If credithours < 21 Then MsgBox "Your chosen courses are less than 21 credit hours", vbCritical, "Attention" End If If credithours = 21 Then MsgBox "Congratulation! You have successfully registered the courses. Welcome to UUM!", vbDefaultButton1, "Congratulation!" End If End Sub Private Sub Command2_Click() If Check1.Value = 1 Then credithours = credithours + 3 End If If Check2.Value = 1 Then credithours = credithours + 3 End If If Check3.Value = 1 Then credithours = credithours + 3 End If If Check4.Value = 1 Then credithours = credithours + 3 End If If Check5.Value = 1 Then credithours = credithours + 3 End If If Check6.Value = 1 Then credithours = credithours + 3 End If If Check7.Value = 1 Then credithours = credithours + 3 End If If Check8.Value = 1 Then credithours = credithours + 3 End If If Check9.Value = 1 Then credithours = credithours + 3 End If txtTotal.Text = credithours If credithours > 21 Then MsgBox "Your chosen courses are more than 21 credit hours", vbCritical, "Attention" txtTotal.Text = "" Check1.Value = 0 Check2.Value = 0 Check3.Value = 0 Check4.Value = 0 Check5.Value = 0 Check6.Value = 0 Check7.Value = 0 Check8.Value = 0 Check9.Value = 0 End If If credithours < 21 Then MsgBox "Your chosen courses are less than 21 credit hours", vbCritical, "Attention" End If If credithours = 21 Then MsgBox "Congratulation! You have successfully registered the courses. Welcome to UUM!", vbDefaultButton1, "Congratulation!" End If End Sub