none
Close a form opened as Dialog thru VBA RRS feed

  • Question

  • Fellow Accessor's,

    I have a modal form that is NOT popup. But I need to open it up as dialog - so it performs somewhat like a popup.

    I have the need to close that form WHILE it is open waiting for user response. The docmd.Close ....,"formname",,,,saveno will not do it.

    Any other approaches other than sendkey?

    Mark

    Wednesday, October 19, 2016 1:13 PM

Answers

All replies

  • I don't get the scenario. Not sure what you consider "dialog" behavior and how it relates to "popup"

    Isn't it rude to close the form while users haven't entered their response yet?

    Maybe you mean you have a modal form which you want to close after a given amount of time? Tick a timer inside the form and the standard DoCmd.Close acForm, me.Name would close it.

    I have a feeling there's a lot you're not telling us.


    -Tom. Microsoft Access MVP

    Wednesday, October 19, 2016 2:00 PM
  • Hi  Tom,

    Sorry. Let me be clearer. You thought is correct.

    We have a timer in the background. If they have not responded in that dialog displayed form within a certain amount of time, we want to close that dialog form. And, yes, we already have a message on the screen of why we did it - gone beyone time limit.

    They already know there is a limit. So, the reason for all of this is not really important.

     I need to know how to close a form that is opened as dialog. Closing it from the timer.

    Thanks,
    MG

    Wednesday, October 19, 2016 2:05 PM
  • It works for me as I described in first instance. Sample db is here: https://1drv.ms/u/s!AnmKsZFxs8_KhsxgCBoaGM0sGvDbeA


    -Tom. Microsoft Access MVP

    Wednesday, October 19, 2016 2:18 PM
  • DoCmd.Close acForm, "YourFormName" should work without issue.  What problem have you experienced?  What error do you receive?  Please explain things further.

    Daniel Pineault, 2010-2016
    Microsoft MVP Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Wednesday, October 19, 2016 2:59 PM
  • Hi Daniel,

    there is no error.

    The command fires, and the form that was displayed as dialog just sits there.

    It is being fired

    The form name is correct.

    MG

    Wednesday, October 19, 2016 4:38 PM
  • Guys,

    Please disregard this entire problem. I found the issue. There was a type'O that two of us missed.

    Sorry for the inconvenience.

    MG

    Wednesday, October 19, 2016 4:45 PM
  • No problem.  Glad you got it sorted out!

    Daniel Pineault, 2010-2016
    Microsoft MVP Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Wednesday, October 19, 2016 4:53 PM