Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exit Sub ?

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
BG
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 ?




 
Hi!

In the click event of the list box use:

YourButton.Enabled = False

Don't forget to reenable the button where appropriate such as in the form's Current event.

hth


Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top