Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exit sub ? (Access 2000)

    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 ordfer 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 clicked list box ListOrders?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Exit sub ? (Access 2000)

    A list box is not "True" or "False". If you would disable the button when the user clicks the list box, does that mean that the user won't ever be able to click the button after that? What kind of error occurs if the user clicks the button after having clicked the list box?

    You will have to provide much more information.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Exit sub ? (Access 2000)

    Question seems to have been reposted in <post#=483296>post 483296</post#>. This thread is locked to avoid confusion and duplication. All replies in the new thread please.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •