How to know from what form current form was open?

crododo

Registered User.
Local time
Today, 14:39
Joined
May 2, 2013
Messages
27
Hi,
I have a form called frmResoult that can be opened from 3 diferent forms, so when I am closing form frmResoult I wish to open form from wich I entered this form.
Is that possible and how
I had some idea in vba like if then but I do not now how to find command that can determeb where form was open from
Thx for help
 
I might just leave the other form open behind this one, but you could use OpenArgs to pass the name of the form to frmResoult and it could use that to open the previous form.
 
You could pass the name of the calling form as the OpenArgs argument of the OpenForm command.

Then use the OpenArgs property of the form to open the original form again in the OnClose event procedure.

Often in this situation a developer will set the Visible property of the original form to False and change it back when the other form closes. OpenArgs could be used similarly for this too.
 
can you plea<se give me an example how can I add arg?
 
Hello crododo,

Try something like..
Code:
DoCmd.OpenForm "[COLOR=Red][B]<<yourFormName>>[/B][/COLOR]", OpenArgs:= Me.Name
Then to access the open args in the <<yourFormName>> just use Me.OpenArgs.. Hope this helps..
 

Users who are viewing this thread

Back
Top Bottom