Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2011
    Posts
    5

    Unanswered: Disabling buttons

    I have a form with a list box control that passes a person’s name to be filtered into a query. I have several buttons that open different queries. How can I get the button to deactivate if a person’s name is not an action party of the query? For example Joe may have actions for Query “A” and “C” but not “B”. I want button B to deactivate when Joe's name is selected from the list.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You could use something like:
    Code:
    If Me.ListBoxName.Value = "Joe" then
        Me.Command_QueryB.Enabled = False
    Else
        Me.Command_QueryB.Enabled = True
    End If
    Or (shorter but harder to understand):
    Code:
    Me.Command_QueryB.Enabled = Not Me.ListBoxName.Value = "Joe"
    Provide more details about the list contents and its structure if you want a more precise answer.
    Have a nice day!

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by Sinndho View Post
    Provide more details about the list contents and its structure if you want a more precise answer.
    As well as the structure of the involved tables and SQL statements of the query: I don't know anything about your database and I have no crystal ball.
    Have a nice day!

Posting Permissions

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