Results 1 to 2 of 2

Thread: Raiseevents not functioning

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251

    Raiseevents not functioning

    I have two forms, a parent form and a child form which is launched from the parent. As the child form can differ I want to create an event in the parent form and sent it to the child form.

    My code does not fire the event in the child form any ideas. Is it possible to do this in forms

    Parent form code.....

    Public Event Myevent()

    Private Sub Command1_Click()
    Form2.Show
    End Sub

    Private Sub Command2_Click()
    RaiseEvent Myevent
    End Sub

    --------------------------------------------------------------------------------
    Child form code...
    Private WithEvents frm As Form1

    Private Sub frm_Myevent()
    Text1.Text = "Got it"
    End Sub
    Control Data Systems
    www.members.shaw.ca/cdsystems

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    Hmm... you're like trying to do an event that will be called on each of the child forms? Why so? You could just go through each of the child forms. For example:

    VB Code:
    1. Dim A As Integer
    2. For A = 0 To Forms.Count - 1
    3.     If Forms(A).Name = "ChildType1" Or "ChildType2" Then
    4.          'do stuff to that form
    5.     End If
    6. Next A

    Though it'd be easier to help if I knew what you're trying to do (meaning, why you want to do that).

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