If user wants to change back from a Quote or Invoice then ask for confirmation.
Here is what I have so far using a OnClickEvent for a Label. Call EnableCtl is in a Module.ModDate and sets the Label to "This is a Quote" or "Posted as a Invoice"
Call TimeCardCounter is a module named ModTimeCardCounter that advances the Invoice number by one.
Code: Select all
If Not IsNull(CustomerID) And Not IsNull(TimeCounter) Then
Call MsgBox("Order Has Already Been Posted As a Invoice!", vbExclamation, Application.Name)
Exit Sub
End If
If Not IsNull(CustomerID) And IsNull(TimeCounter) Then ' Post as Invoice.
Call TimeCardCounter
TimeCounter = Format(DLookup("[NextAvailableCounter]", "TTimeCardCounter"), "######")
End If
DoCmd.RunCommand acCmdSave
Call EnableCtl
Me.Refresh
Dim strCriteria As String
strCriteria = "[OrderID] = " & Me![txtOrderID]
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE Orders SET Orders.OrderType = -1"
DoCmd.SetWarnings True