Opening and closing forms - order

Damob9K

Trainee numpty
Local time
Today, 22:40
Joined
Apr 12, 2014
Messages
69
Hello all.

Just a quick question . . .
Is there a correct / preferred way of opening one form from another and then going back to the original form ?

Should it be:
DoCmd.OpenForm "new form name"
DoCmd.Close acForm, "original form name"

or
DoCmd.Close acForm, "original form name"
DoCmd.OpenForm "new form name"

Or does it not really matter ?
From what I have done so far, it seems to me that if the form you are opening takes data from the currently open form, you don't want to close it first as the newly opened form will not be able to see the data within it.
Or have I got that wrong

Thanks
Damian
 
If you use:
Code:
DoCmd.OpenForm "NameOfFormToOpen", , , , , acDialog
Msgbox "Code execution resumes here only after NameOfFormToOpen has closed"
the message box will not be shown until the form being opened has closed.
 
Ahh yes I get it :banghead: so it's the same as a remote procedure call or jump function . . that fit's in with your answer to my previous question/post.

If only I could remember more from my COBOL days :confused:

Cheers
D
 
Ahh yes I get it :banghead: so it's the same as a remote procedure call or jump function . . that fit's in with your answer to my previous question/post.

If only I could remember more from my COBOL days :confused:

Cheers
D
Sorry, but I am unable to comment on this. I no nothing about COBOL. I have enough trouble trying to use VBA :eek:
 
Thanks AccessBlaster,

I never really thought of it like that, just thought that closing and then opening one form from another was the way to do it !!

I'll certainly look at recoding things if it make a difference to the speed of things.

Cheers

Damob
 

Users who are viewing this thread

Back
Top Bottom