I have the following code:
Private Sub cmb_status_AfterUpdate()
DoCmd.SetWarnings False
Dim CancelUpdate As String
If Me.cmb_status = 5 Then
If IsNull(Me.CompleteDate) Then
MsgBox "Cannot update Status to Complete until Complete Date and Time to Complete are populated."
CancelUpdate = "Update T_Tickets set StatusId = null where Ticketid = " & Forms!F_UpdateTicket.Txt_TicketNo
DoCmd.RunSQL (CancelUpdate)
Me.Requery
Else
If IsNull(Me.cmb_CompleteTime) Then
MsgBox "Cannot update Status to Complete until Complete Date and Time to Complete are populated."
Else
End If
End If
Else
End If
DoCmd.SetWarnings False
End Sub
The CANCELUPDATE script is not taking place.
Basically, I have a combo box to select from but if they select "Complete", the system needs to check to see if Complete Date and Time to complete have been populated. If not, then it needs to cancel the update to the status combo box and leave it blank until those two fields have been populated. Please help.
Private Sub cmb_status_AfterUpdate()
DoCmd.SetWarnings False
Dim CancelUpdate As String
If Me.cmb_status = 5 Then
If IsNull(Me.CompleteDate) Then
MsgBox "Cannot update Status to Complete until Complete Date and Time to Complete are populated."
CancelUpdate = "Update T_Tickets set StatusId = null where Ticketid = " & Forms!F_UpdateTicket.Txt_TicketNo
DoCmd.RunSQL (CancelUpdate)
Me.Requery
Else
If IsNull(Me.cmb_CompleteTime) Then
MsgBox "Cannot update Status to Complete until Complete Date and Time to Complete are populated."
Else
End If
End If
Else
End If
DoCmd.SetWarnings False
End Sub
The CANCELUPDATE script is not taking place.
Basically, I have a combo box to select from but if they select "Complete", the system needs to check to see if Complete Date and Time to complete have been populated. If not, then it needs to cancel the update to the status combo box and leave it blank until those two fields have been populated. Please help.