I have a button for exit from the application that works fine :
CancelOrderOnExit
DoCmd.Close acForm, Me.Name
Application.Quit acPrompt
However, if the user clicks by inadverence the listbox called ListOrders then an error is set in cancelling the order.In order to avoid that i have added a code to exit the sub,by the error is given again:
If Me!ListOrders = True Then
Exit Sub
Else
CancelOrderOnExit
DoCmd.Close acForm, Me.Name
Application.Quit acPrompt
End If
How can i make the button inactive if i have clisked the list box ListOrders ?
CancelOrderOnExit
DoCmd.Close acForm, Me.Name
Application.Quit acPrompt
However, if the user clicks by inadverence the listbox called ListOrders then an error is set in cancelling the order.In order to avoid that i have added a code to exit the sub,by the error is given again:
If Me!ListOrders = True Then
Exit Sub
Else
CancelOrderOnExit
DoCmd.Close acForm, Me.Name
Application.Quit acPrompt
End If
How can i make the button inactive if i have clisked the list box ListOrders ?