Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Save_Click()
'********************************
'* Declaration Specifications *
'********************************
Dim varResponse As Variant
On Error GoTo Err_Save_Click
'*********************
'* Display message *
'*********************
varResponse = MsgBox("Would like to close this ticket now?", vbYesNoCancel + vbQuestion)
If (varResponse = vbYes) Then
If IsNull(Me.Answer_Comments) Or IsNull(Me.RequestedQuestion) Then
MsgBox "You must provide a question and an answer before closing the ticket"
GoTo Exit_Save_Click
End If
If IsNull(Me.Call_Source) Then
MsgBox "You must provide a Call Source"
Me.Call_Source.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.Area) Then
MsgBox "You must provide an Area"
Me.Area.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.Caller_Status) Then
MsgBox "You must provide a Caller Status"
Me.Caller_Status.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.CallerName) Then
MsgBox "You must provide a Caller Name"
Me.CallerName.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.CostCenter) Then
MsgBox "You must provide a Cost Center"
Me.CostCenter.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.EMPID) Then
MsgBox "You must provide a Employee ID"
Me.EMPID.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.JobTitle) Then
MsgBox "You must provide a Job Title"
Me.JobTitle.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.Telephone) Then
MsgBox "You must provide a Telephone Number"
Me.Telephone.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
If IsNull(Me.CompanyName) Then
MsgBox "You must provide a Company Name"
Me.CompanyName.BackColor = RGB(255, 255, 0)
GoTo Exit_Save_Click
End If
Me.Date_Closed = Now()
Me.TicketStatus = "Closed"
Me.Lock = True
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbInformation
ElseIf (varResponse = vbNo) Then
MsgBox "The status of this ticket is Pending, please return to this ticket later.", vbInformation
Me.TicketStatus = "Pending"
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbInformation
ElseIf (varResponse = vbCancel) Then
Forms!frmMain.SetFocus
End If
'********************
'* Exit Procedure *
'********************
Exit_Save_Click:
Exit Sub
'****************************
'* Error Recovery Section *
'****************************
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End Sub
Private Sub Save_Click()
'********************************
'* Declaration Specifications *
'********************************
Dim strMsg As String
Dim varResponse As Variant
On Error GoTo Err_Save_Click
'************************************
'* Assume everything is filled in *
'************************************
strMsg = vbNullString
Me.Call_Source.BackColor = 0 'Background color of 0
Me.Area.BackColor = 0
Me.Caller_Status.BackColor = 0
Me.CallerName.BackColor = 0
Me.CostCenter.BackColor = 0
Me.EMPID.BackColor = 0
Me.JobTitle.BackColor = 0
Me.Telephone.BackColor = 0
Me.CompanyName.BackColor = 0
'*********************
'* Display message *
'*********************
varResponse = MsgBox("Would like to close this ticket now?", vbYesNoCancel + vbQuestion)
If (varResponse = vbYes) Then
If IsNull(Me.Answer_Comments) Or IsNull(Me.RequestedQuestion) Then
MsgBox "You must provide a question and an answer before closing the ticket"
GoTo Exit_Save_Click
End If
If IsNull(Me.Call_Source) Then
strMsg = "You must provide a Call Source" & vbCrLf
Me.Call_Source.BackColor = 255
End If
If IsNull(Me.Area) Then
strMsg = strMsg & "You must provide an Area" & vbCrLf
Me.Area.BackColor = 255
End If
If IsNull(Me.Caller_Status) Then
strMsg = strMsg & "You must provide a Caller Status" & vbCrLf
Me.Caller_Status.BackColor = 255
End If
If IsNull(Me.CallerName) Then
strMsg = strMsg & "You must provide a Caller Name" & vbCrLf
Me.CallerName.BackColor = 255
End If
If IsNull(Me.CostCenter) Then
strMsg = strMsg & "You must provide a Cost Center" & vbCrLf
Me.CostCenter.BackColor = 255
End If
If IsNull(Me.EMPID) Then
strMsg = strMsg & "You must provide a Employee ID" & vbCrLf
Me.EMPID.BackColor = 255
End If
If IsNull(Me.JobTitle) Then
strMsg = strMsg & "You must provide a Job Title" & vbCrLf
Me.JobTitle.BackColor = 255
End If
If IsNull(Me.Telephone) Then
strMsg = strMsg & "You must provide a Telephone Number" & vbCrLf
Me.Telephone.BackColor = 255
End If
If IsNull(Me.CompanyName) Then
strMsg = strMsg & "You must provide a Company Name" & vbCrLf
Me.CompanyName.BackColor = 255
End If
If (strMsg <> vbNullString) Then 'IF True, then incomplete
MsgBox Mid(strMsg, 1, Len(strMsg) - 2) 'Get rid of last vbcrlf
GoTo Exit_Save_Click
en dif
Me.Date_Closed = Now()
Me.TicketStatus = "Closed"
Me.Lock = True
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbInformation
ElseIf (varResponse = vbNo) Then
MsgBox "The status of this ticket is Pending, please return to this ticket later.", vbInformation
Me.TicketStatus = "Pending"
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbInformation
ElseIf (varResponse = vbCancel) Then
Forms!frmMain.SetFocus
End If
'********************
'* Exit Procedure *
'********************
Exit_Save_Click:
Exit Sub
'****************************
'* Error Recovery Section *
'****************************
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End Sub