Wait for a form to close.

  • Thread starter Thread starter aragorn
  • Start date Start date
A

aragorn

Hi,

When using "DoCmd.OpenForm <form name>" in a private sub,
is it possible to stop the sub execution untill the <form name> form
is closed?

Alexis
 
Yes, if you open the form in dialog mode.

Using positional arguments:
DoCmd.OpenForm "frmProducts", , , , , acDialog

Using named arguments (better method):
DoCmd.openForm FormName:="frmProducts", WindowMode:=acDialog

Tom
________________________________________


Hi,

When using "DoCmd.OpenForm <form name>" in a private sub,
is it possible to stop the sub execution untill the <form name> form
is closed?

Alexis
 
I am not sure I understood your question. Why would you want to close the
Form and then re-open it straight away?

If you want to refresh the data, check the Requery Method of the Form
object.
 
Ï "Van T. Dinh said:
I am not sure I understood your question. Why would you want to close the
Form and then re-open it straight away?

I'm not sure how I gave you that idea... I'm not trying to do that.
What Tom Wickerath suggested solved my problem.

Thank you both, anyway.
Alexis
 
I mis-interpreted your question that you wanted when the OpenForm is
executes and if the <form name> is *already* open, hold the OpenForm action,
close the Form <form name> and then re-open it after it has been close.

Some new users do this to refresh the data on the Form.

Like I wrote, I wasn't sure I understood your question fully.
 
Back
Top