Hi,
I have a form where users go to create help tickets, when they decide to close a ticket they would click on the save ticket. This button will save and close the ticket.
On the this form there are two textboxs "Question" and "Answers". I want that when the user decides to close the ticket that a "question" and "answer" be provided before closing and saving the ticket. How can I go about doing this? Below is the code I am using for the On Click Save button:
[tt]Private Sub Save_Click()
On Error GoTo Err_Save_Click
If MsgBox("Would like to close this ticket now?", vbYesNo + vbQuestion) = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Date_Closed = Now()
Me.TicketStatus = "Closed"
Me.Lock = True
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbOKOnly + vbInformation = vbOK
Else
If MsgBox("Would like to close this ticket now?", vbYesNo + vbQuestion) = vbNo Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If MsgBox("The status of this ticket is Pending, please return to this ticket later.", vbQuestion) = vbOK Then
Me.TicketStatus = "Pending"
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbOKOnly + vbInformation = vbOK
End If
Exit_Save_Click:
Exit Sub
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End If
End If
End Sub[/tt]
I have a form where users go to create help tickets, when they decide to close a ticket they would click on the save ticket. This button will save and close the ticket.
On the this form there are two textboxs "Question" and "Answers". I want that when the user decides to close the ticket that a "question" and "answer" be provided before closing and saving the ticket. How can I go about doing this? Below is the code I am using for the On Click Save button:
[tt]Private Sub Save_Click()
On Error GoTo Err_Save_Click
If MsgBox("Would like to close this ticket now?", vbYesNo + vbQuestion) = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Date_Closed = Now()
Me.TicketStatus = "Closed"
Me.Lock = True
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbOKOnly + vbInformation = vbOK
Else
If MsgBox("Would like to close this ticket now?", vbYesNo + vbQuestion) = vbNo Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If MsgBox("The status of this ticket is Pending, please return to this ticket later.", vbQuestion) = vbOK Then
Me.TicketStatus = "Pending"
DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbOKOnly + vbInformation = vbOK
End If
Exit_Save_Click:
Exit Sub
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End If
End If
End Sub[/tt]