-
if i show a from as modal using, for example
frmBookings.Show 1,Me
How do I find get name of the owner form.
The reason for this being frmBookings can be opened from various forms, and one of the buttons on it has to close it, as well as it's owner.
I was hoping there would be something simple like a .Owner property, but unfortuantley not....
-
Use :
[Code]
Form.Show vbModal
{/Code]
-
Add the following code to frmBookings:
Code:
Option Explicit
Private mstrOwner As String
Public Property Get BookingsOpenedBy() As String
BookingsOpenedBy = mstrOwner
End Property
Public Property Let BookingsOpenedBy(ByVal strOpenedBy As String)
mstrOwner = strOpenedBy
Me.Show vbModal
End Property
Then if, say, you want to open frmBookings from Form1, do this in Form1:
Form2.BookingsOpenedBy = "Form1"
-
hurrah!!
that worked a treat!
cheers...
-
I'm glad that you figured out that
Form2.BookingsOpenedBy = "Form1"
should have been
frmBookings.BookingsOpenedBy = "Form1"