Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linked forms - which form called this form

Status
Not open for further replies.

mgargUWBC

Instructor
May 22, 2003
9
US
Here's some background and my question -

FormA contains a button, that when clicked brings up FormX. FormB also contains a button that when clicked brings up FormX.

Is there a way to tell whether FormA or FormB called FormX (from inside the code of FormX)? Basically I need to know how I got into FormX once I'm already in there. Can I look "backward" to the form that called FormX?

TIA,
Michelle
 
You may consider playing with the FormX.OpenArgs property.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi mgargUWBC.

As far as I know you can't see how FormX was invoked, but you can check which of FormA and FormB is loaded which might be enough for you; it will only work, though, if only one of them can be open at a time.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
you can have a variable and assign "formA" to it the when formX opens it can read the variable and know which form opened it. i use this all the time.

module:
Public fromFORM As String

formA:
button:
fromFORM = "formA"
'open formX code here

formX:
form load:
if fromFORM = "formA" then
'do something here if from formA
elseif fromFORM = "formB" then
'do something here if from formB
end if
 
THANKS!

PVH put me on the right track and I ended up coding a solution almost identical to drctx. Works like a charm.

Michelle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top