Close and reopen same form

syntaktik

Registered User.
Local time
Tomorrow, 02:41
Joined
Oct 15, 2009
Messages
68
Is there a way to close the form, and reopen it again? Since I am sure when I were to open the same form again, and then use the close command, it would close the last one I made, so it wouldn't help me. Nor would a VBA code help since after the close, it would prevent the open code from running.
Any clues?
 
Why do you want to do this? When this question is usually asked the solution is to simply requery the form, using Me.Requery.
 
It is my low tech solution to the hidden column problem I am having. When ever I hide columns with the button, they wont hide till I reopen the form.
 
It is my low tech solution to the hidden column problem I am having. When ever I hide columns with the button, they wont hide till I reopen the form.
I ran into an issue, not unlike yours, where I needed to update/recreate a query definition which, for what ever reason, would not refresh the form even with a me.requery command. That said, to close and reopen the same form you can use the following code

DoCmd.Close
DoCmd.OpenForm "form name"

If your form has multiple records and you need to navigate to your previous record, you will need to capture the record's id before the close command and create code to navigate to that record after the open command.
 

Users who are viewing this thread

Back
Top Bottom