Hi Guys,
I have a question regarding a "Save Button" I have on a form. I want the user to click on this button: after they complete a form. The button should asked the user whether the ticket is closed. If the user clicks on yes then the the button will save the ticket and mark it close on a combobox labeled "Ticket Status".
IF the user clicks on No, a question is asked as to "what would you like to do route it or leave it open" If the user selects route to: The "Route To" combobox will be enabled and will saved the ticket. if the user selects open: the ticket will be saved and will be mark open.
This is what i have done which i know is wrong but hopefully someone can tweak it..thanks
Private Sub Save_Click()
On Error GoTo Err_Save_Click
If MsgBox("Is this Ticket Close?", vbYesNo + vbQuestion) = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Solved_by.Enabled
Me.Date_Closed.Enabled
Me.Ticket_Status = "Closed"
Else
MsgBox("What would you like to do?", vbRouteOpen + vbQuestion) = vbRoute
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Route_To.Enabled
Me.Date_Routed_1.Enabled
Me.Ticket_Status = "Routed"
Exit Sub
Exit_Save_Click:
Exit Sub
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End Sub
I have a question regarding a "Save Button" I have on a form. I want the user to click on this button: after they complete a form. The button should asked the user whether the ticket is closed. If the user clicks on yes then the the button will save the ticket and mark it close on a combobox labeled "Ticket Status".
IF the user clicks on No, a question is asked as to "what would you like to do route it or leave it open" If the user selects route to: The "Route To" combobox will be enabled and will saved the ticket. if the user selects open: the ticket will be saved and will be mark open.
This is what i have done which i know is wrong but hopefully someone can tweak it..thanks
Private Sub Save_Click()
On Error GoTo Err_Save_Click
If MsgBox("Is this Ticket Close?", vbYesNo + vbQuestion) = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Solved_by.Enabled
Me.Date_Closed.Enabled
Me.Ticket_Status = "Closed"
Else
MsgBox("What would you like to do?", vbRouteOpen + vbQuestion) = vbRoute
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Route_To.Enabled
Me.Date_Routed_1.Enabled
Me.Ticket_Status = "Routed"
Exit Sub
Exit_Save_Click:
Exit Sub
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End Sub