Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246

    Unanswered: Invisible commands

    Hi
    I'm haveing a very bad brain fade day.

    Got a form that has a number of fields on it. When one particular field ( a combo) is populated I want a command button to appear. So on the combo's event AfterUpdate I've put some code to make the command button visible, this works fine except its also visible in all the other records even when they don't have this combo populated

    John

  2. #2
    Join Date
    Sep 2003
    Location
    UK
    Posts
    122

    Question

    Quote Originally Posted by Sticker
    Got a form that has a number of fields on it. When one particular field ( a combo) is populated I want a command button to appear. So on the combo's event AfterUpdate I've put some code to make the command button visible, this works fine except its also visible in all the other records even when they don't have this combo populated

    John
    What event populates the combo? That might be one way to do it, hook the event to unhide the command button.

    I take it that you are useing cmdMyButton.visible = false as part of the form on load AND form on change events?
    Matt the Hat says: "what!?"
    A child of five could understand this! Fetch me a child of five!
    SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Hmmm ... So your "zero" condition is the button is not visible and the combobox is not populated. You populate the combobox and unhide the button. What do you mean by "populate"? Select from the combobox? Load data into the combobox? Matt has the right idea ... All you need to do is hide/unhide the button but we need to know WHEN ...
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Thanks Guys for teh replies
    When I say "populate" I mean when the user selects an item from the drop down list.
    So the button is visible when a selection is made and also on other records when a selection has been previously made, but it should not be visible on any records where a selection from thsi combo box has not been made. The form in question is singular records at a time

    Regards
    John

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    What kind of form is this? And where is this button located at?
    Back to Access ... ADO is not the way to go for speed ...

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Ah, here's the thing, when you set properties for a control on the form, you're setting the properties for the CONTROL, not the record. So, if you wish to re-evaluatethe control each time you move to another record, you will have to do so manually in the OnCurrent event (or something similar) of the form.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Teddy
    Ah, here's the thing, when you set properties for a control on the form, you're setting the properties for the CONTROL, not the record. So, if you wish to re-evaluatethe control each time you move to another record, you will have to do so manually in the OnCurrent event (or something similar) of the form.
    Or even the Form_AfterUpdate event ... Which fires upon the moving from 1 record to another ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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