Results 1 to 5 of 5

Thread: modal forms

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276
    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....

  2. #2
    Guest

    Talking

    Use :

    [Code]
    Form.Show vbModal
    {/Code]




  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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"



  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276

    hurrah!!

    that worked a treat!

    cheers...

  5. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width