Link to home
Start Free TrialLog in
Avatar of isnoend2001
isnoend2001Flag for United States of America

asked on

vb6 what is a forms owner ?

I am trying to write some code in a forms queryunload.
is the form that opened it the forms owner or can i specify the owner ?
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Module code:
Option Explicit

Public gstrOpenedBy As String

Open in new window


Form1 code:
gstrOpenedBy = Name
Form2.Show

Open in new window


Form2 code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
MsgBox "The form that opened me is " & gstrOpenedBy

End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of isnoend2001

ASKER

thanks now i know
You're welcome and I'm glad I was able to help.

Select the 'About Me' tab in my profile and you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2013