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

    Unanswered: Cmb button visible/invisble through macro

    Hi,
    Can anyone tell me how I can make a command button on a form invisble when a macro runs and by the same token another command button visble?

    Regards
    John

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    Using vba:

    cmdButton.visible = true/false

  3. #3
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Thanks namliam for the reply, unforunately I need to do this through a macro

    Regards
    John

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Red face

    Quote Originally Posted by Sticker
    Thanks namliam for the reply, unforunately I need to do this through a macro

    Regards
    John
    Why do you just Have to do it through a macro? VBA does what a macro does and then some. What actions are you taking to make it Visible / Invisible?

    Bud

  5. #5
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Hi
    The macro is doing various comparisons of data using DCount and depending on the value retuned will then present the user with the form (if applicable). All this is done during a data import routine which involves around 50 macro's and over 200 queries running. The form that is presented to the user needs to then call another macro when the user exits, but I'm not sure how this is achieved by using the standard form exit button as then the macro comes to a halt. In fact depending on what each of the succeeding 5 macro's does they have to then call another form (each one different) This is all done to validate the imported data.
    What I was hoping to do was to create another exit button on each of the forms and if the DCount criteria is met then the normal exit button is made invisble and the new button visible. This way when the user clicks on the exit button it will call the next macro.

    There's probably an easier way to do this when the macro is making the evaluation but I don't know how to do it

    Clear as mud

    Regards
    John

  6. #6
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi John,

    I will see if I can come up with something for this if no one else does. Can still be done with VBA to come into play when some condition in a macro or action in a form triggers it. Hang tight and will see what we can do. I too used to do all macros until I learned VBA, (still learning and no pro). They are good but when moving the database around it got too much trying to make sure I included all the needed Macros. VBA form/report modules are attached and no need to remember where the code is. I learned by using the ConvertMacrosToCode function in A2K. Really kinda neat. Anyhow, I will see if I come up with a solution for you.

    have a nice one,
    Bud

  7. #7
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Thanks Bud, much appreciated

Posting Permissions

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