Results 1 to 4 of 4

Thread: ActiveX control w/ modal form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Location
    MSDN-land
    Posts
    24

    Unhappy ActiveX control w/ modal form

    I've made an activex control which has a method to search a db table, and shows a modal form (part of the control project) to accept search terms. I need to run a method in the control in response to a button click on the form, but I keep getting "Sub or Function not defined" and execution crashes on the line calling the method.

    Code in the form:
    ------------------------------------------
    Private Sub cmdSearch_Click()
    Dim x As String
    x = DoSearch(keywords)
    End Sub
    ------------------------------------------

    Code in the control:
    ------------------------------------------
    Public Function DoSearch(SearchFor as String)
    'do the search
    End Function
    ------------------------------------------

    Tried it as an event, too--crashed on same line.
    Can I not call an event in a control from a form within the control's project? Am I missing something? Please help.

    Thanks!
    &sylvania;
    ---------------------------------------

    VB6:Perl:ASP:JS:HTML:English
    (in that order)

    MCP

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Location
    Sydney, Australia
    Posts
    74
    you would need to prefix the function/sub name with the object name.


    If your activex control on the form is called y then do
    x = y.DoSearch(keywords)

    The function itself is not really defined it is only a member function of the control

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Location
    MSDN-land
    Posts
    24

    Smile Thank You!

    Thanks so much, Andrew! Very helpful, and the method is executing.



    Thanks!
    &sylvania;
    ---------------------------------------

    VB6:Perl:ASP:JS:HTML:English
    (in that order)

    MCP

  4. #4
    Member
    Join Date
    Jan 2002
    Location
    india
    Posts
    44
    hi
    will u hepl me out in making the dll to convert the text into html file in which i have one rich text box and other uttob while clicking tyhe button the text box lines shold be conerted into html file
    bye
    ms rajender
    rajender

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