Dim CurrentRow As Long
'Clear-The Current Record From the User-Form And Set the Curso on the Cmbo Box
Private Sub cmdClear_Click()
cboPARCS.Text = ""
txtNumber = ""
txtIlevel = ""
txtDiscription = ""
txtDesgnaOperator = ""
txtTimeCalled = ""
txtDateCalled = ""
txtTechAssigned = ""
txtDateTechAssigned = ""
txtTimeCompleted = ""
txtDateCompleted = ""
txtComments = ""
End Sub
'Clear-The Current Record From the User-Form And Set the Curso on the Cmbo Box
Private Sub cmdClear_Click()
cboPARCS.Text = ""
txtNumber = ""
txtIlevel = ""
txtDiscription = ""
txtDesgnaOperator = ""
txtTimeCalled = ""
txtDateCalled = ""
txtTechAssigned = ""
txtDateTechAssigned = ""
txtTimeCompleted = ""
txtDateCompleted = ""
txtComments = ""
End Sub
'Add Records to the User-Form By first loacating The Next Blank Row
Private Sub cmdAdd_Click()
If cboPARCS.Text = "" Then
MsgBox "Please Select a RCS OPERATORS Name From The List Provided."
cboPARCS.SetFocus
Exit Sub
End If
If txtNumber.Text = "" Then
MsgBox "You MUST! Enter A Ticket Number."
txtNumber.SetFocus
Exit Sub
End If
If cboIlevel.Text = "" Then
MsgBox "Please Select A INCIDENT LEVEL From The List Provided."
cboIlevel.SetFocus
Exit Sub
End If
If txtDiscription.Text = "" Then
MsgBox "You MUST! Enter A Detail Discription Of The Problem."
txtDiscription.SetFocus
Exit Sub
End If
If txtTechAssigned.Text = "" Then
MsgBox "You MUST! Enter A Technician Assigned To The Problem."
txtTechAssigned.SetFocus
Exit Sub
End If
If txtDesignaOperator.Text = "" Then
MsgBox "You MUST! Enter The Name Of The Designa Operator You Call OR Print Out Report."
txtDesignaOperator.SetFocus
Exit Sub
End If
If txtTimeloged.Text = "" Then
MsgBox "You MUST! Enter The Time Designa Operator Was Call OR The Time You Printed Out The Report."
txtTimeloged.SetFocus
Exit Sub
End If
If txtDateLoged.Text = "" Then
MsgBox "You MUST! Enter The Date Designa Operator Was Call OR The Date You Printed Out The Report."
txtDateLoged.SetFocus
Exit Sub
End If
If txtDateAssigned.Text = "" Then
MsgBox "You MUST! Enter The Date Designa Tech Was Assigned the Job."
txtDateAssigned.SetFocus
Exit Sub
End If
If txtTimeCompleted.Text = "" Then
MsgBox "You MUST! Enter The Time Designa Tech Finished the Repairs."
txtTimeCompleted.SetFocus
Exit Sub
End If
If txtDateCompleted.Text = "" Then
MsgBox "You MUST! Enter The Date Designa Tech Finished the Repairs."
txtDateCompleted.SetFocus
Exit Sub
End If
If txtComments.Text = "" Then
MsgBox "Enter Any Comments Or What Was Repaired By The Designa Tech."
txtComments.SetFocus
Exit Sub
End If
Erow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(Erow, 1) = cboPARCS.Text
Cells(Erow, 2) = txtNumber.Text
Cells(Erow, 3) = cboIlevel.Text
Cells(Erow, 4) = txtDiscription.Text
Cells(Erow, 5) = txtTechAssigned.Text
Cells(Erow, 6) = txtDesignaOperator.Text
Cells(Erow, 7) = txtTimeloged.Text
Cells(Erow, 8) = txtDateLoged.Text
Cells(Erow, 9) = txtDateAssigned.Text
Cells(Erow, 10) = txtTimeCompleted.Text
Cells(Erow, 11) = txtDateCompleted.Text
Cells(Erow, 12) = txtComments.Text
End Sub
'Deletes Info from Sheet1
Private Sub cmdDelete_Click()
Answer = MsgBox("Are You Sure You Want To Delete This Record?", vbYesNo + vbQuestion, "Delete Record")
If Answer = vbYes Then
Cells(CurrentRow, 1).EntireRow.Delete
End If
End Sub
'Next Button-Navigates To The Next Record
Private Sub cmdNext_Click()
Dim LastRow As Long
LastRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
If CurrentRow = LastRow Then
MsgBox "You Are Now At The Last Record.", vbCritical
Else
CurrentRow = CurrentRow + 1
cboPARCS.Text = Cells(CurrentRow, 1)
txtNumber.Text = Cells(CurrentRow, 2)
cboIlevel.Text = Cells(CurrentRow, 3)
txtDiscription.Text = Cells(CurrentRow, 4)
txtTechAssigned.Text = Cells(CurrentRow, 5)
txtDesignaOperator.Text = Cells(CurrentRow, 6)
txtTimeloged.Text = Cells(CurrentRow, 7)
txtDateLoged.Text = Cells(CurrentRow, 8)
txtDateAssigned.Text = Cells(CurrentRow, 9)
txtTimeCompleted.Text = Cells(CurrentRow, 10)
txtDateCompleted.Text = Cells(CurrentRow, 11)
txtComments.Text = Cells(CurrentRow, 12)
End If
End Sub
'Previous Button-Navigates To The Previous Record
Private Sub cmdPrevious_Click()
CurrentRow = CurrentRow - 2
If CurrentRow > 1 Then
cboPARCS.Text = Cells(CurrentRow, 1)
txtNumber.Text = Cells(CurrentRow, 2)
cboIlevel.Text = Cells(CurrentRow, 3)
txtDiscription.Text = Cells(CurrentRow, 4)
txtTechAssigned.Text = Cells(CurrentRow, 5)
txtDesignaOperator.Text = Cells(CurrentRow, 6)
txtTimeloged.Text = Cells(CurrentRow, 7)
txtDateLoged.Text = Cells(CurrentRow, 8)
txtDateAssigned.Text = Cells(CurrentRow, 9)
txtTimeCompleted.Text = Cells(CurrentRow, 10)
txtDateCompleted.Text = Cells(CurrentRow, 11)
txtComments.Text = Cells(CurrentRow, 12)
End If
If CurrentRow = 1 Then
MsgBox "You Are Now At The First Record.", vbCritical
CurrentRow = CurrentRow + 1
End If
End Sub
'See A Print Preview of The Sheet
Private Sub cmdPrint_Click()
Dim MySelection
Dim Erow As Long
Dim ItemCode As Long
ItemCode = MsgBox("Are You Sure You Want To Print?", vbOKCancel, "ALERT")
Select Case MySelection
Case vbOK 'Yes,I Want To Proceed
Sheet3.Cells(Erow, 1) = Date
Sheet3.Cells(Erow, 2) = Sheet1.Range("A2")
Sheet3.Cells(Erow, 3) = Sheet1.Range("D6")
Sheet3.Cells(Erow, 4) = Sheet1.Range("D7")
Case vbCancel 'No!
End Select
Sheet3.Range("A2:D7").PrintPreview
'Sheet3.Range("A2:D7").PrintOut
End Sub
'Updates-Updates exitisting Records
Private Sub cmdUpdate_Click()
cboPARCS.Text = Cells(CurrentRow, 1)
txtNumber.Text = Cells(CurrentRow, 2)
cboIlevel.Text = Cells(CurrentRow, 3)
txtDiscription.Text = Cells(CurrentRow, 4)
txtTechAssigned.Text = Cells(CurrentRow, 5)
txtDesignaOperator.Text = Cells(CurrentRow, 6)
txtTimeloged.Text = Cells(CurrentRow, 7)
txtDateLoged.Text = Cells(CurrentRow, 8)
txtDateAssigned.Text = Cells(CurrentRow, 9)
txtTimeCompleted.Text = Cells(CurrentRow, 10)
txtDateCompleted.Text = Cells(CurrentRow, 11)
txtComments.Text = Cells(CurrentRow, 12)
End Sub
'VBA Code For When The User-Form Is Opened
Private Sub UserForm_Initialize()
CurrentRow = 1
cboPARCS.List = Array("AARON JACOB", "ADAMIK DEREK", "ALISE JEAN", "ALSTON SHEREE", "ALVARADO ROGER", "ALVARADO LYNN", "AMPONSAH WILSON", "ATIEMO SAMUEL", "BARAHONA RONY", "BURKE PATRICK", "CHAUDHRY SOHAIB", "CHAUDRY TAHIR", "CRAIG NAILAH", "MARTINEZ GERSON", "MARTINEZ JUAN", "MASSEY MARGARET", "MASSEY DESMOND", "MAYERS LATESHA", "MAZARA ERICK", "MCCULLOUGH JANICE", "MCINTYRE JEWEL", "MILLER ANDREA", "MONTALEMENT HENDWISH", "NICHOLAS LISA", "OFORI PRINCE", "PAGE JAMES", "PANTELEAKIS ARETI", "PERSAUD SHERRINNA", "PETTIGREW DAVID", "PUELLO FELIX", "QUAOFIO SAMUEL", "ROBERTS LISA", "ROBERTS DEVONTAY", "ROMERO IRIS", "SANDERS ROSS-TAMIKA", "SAVAGE JAMES-KISHA", "SCHWARTZ CHRISTOPHER", "SCHWEIKENT THOMAS", "SELDON ZAKIA", "SHIELDS YOLANDA", "SILVA IRMA", "SOMERVILLE NODENE", "SOTO WILFREDO", "SULAIMON MUDASIRU", "SWINSON LAWANNA", "TAYLOR SABRINA", "TERRY JAMERAH", "TOMLINSON MONIQUE", "TRIIBIE GENA", "VALLADARES RALPH", "WILLIAMS CIERA", "ZINGARELLO VINCENT")
cboPARCS = Cells(CurrentRow, 1)
txtNumber = Cells(CurrentRow, 2)
cboIlevel.List = Array("1", "2", "3", "4", "5")
cboIlevel = Cells(CurrentRow, 3)
txtDiscription = Cells(CurrentRow, 4)
txtTechAssigned = Cells(CurrentRow, 5)
txtDesignaOperator = Cells(CurrentRow, 6)
txtTimeloged = Cells(CurrentRow, 7)
txtDateLoged = Cells(CurrentRow, 8)
txtDateAssigned = Cells(CurrentRow, 9)
txtTimeCompleted = Cells(CurrentRow, 10)
txtDateCompleted = Cells(CurrentRow, 11)
txtComments = Cells(CurrentRow, 12)
cboPARCS.SetFocus
cboIlevel.SetFocus
End Sub
Display More