Results 1 to 4 of 4

Thread: Problem with different forms?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    11

    Problem with different forms?

    Well, its like this i have a procedure in form1 and then when i use it on another form it says it doesnt exist, im using the option explicit, and the procedure is public
    Tks, Daniel

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    You need to refer to them like this
    Code:
    frmForm1.Subname
    even if declared public.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    11
    sorry i tries but i couldnt make it work, the names are form1 the procedure name is start, so in the dialog box i tries form1.start it gives the error method or data not found
    tks again

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    I just tried it in VB and it works fine. This is what I did...

    This code is in Form1
    Code:
    Public Sub Start()
    
    MsgBox "I am starting!!"
    
    End Sub
    This code is in form2 attached to a command button
    Code:
    Private Sub Command1_Click()
    
    Form1.Start
    
    End Sub
    When the button on form2 is clicked, the message box shows fine.

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