Results 1 to 5 of 5

Thread: Passing Parameters to Form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Location
    Cirebon - Indonesia
    Posts
    18

    Post

    I want to call and send a parameter to a form
    because normally a form have no parameters

    How can I modify a form so it can accept a parameter ?
    Best regards,
    Privida

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Privida, the easier way is declare a public/global variable. Set the data into this variable before you load the form.

    In the form, then you juz read the data from this variable will do.

    As myself also wanna to know how to make a form to accept parameter passing.


  3. #3
    Lively Member
    Join Date
    Dec 1999
    Posts
    106
    I have always used private member variables in the form and then written a new function like show2 in the form

    i.e. code for form

    Option Explicit
    Private m_sMyString as String

    Public Sub Show2(ByVal sParam as String)
    m_sMyString = sParam
    Me.Show
    End Sub

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Location
    Cirebon - Indonesia
    Posts
    18

    Thumbs up Form's Parameter

    Thank's a lot

    Btw, I want to know if I can use API function to do that ?
    Best regards,
    Privida

  5. #5
    Member Babelfish's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Posts
    38
    I just always use Public varables on the form for the pieces I was to use. that way I initalize them before I show the form and then use the normal event structure. You can also use this to pass data back to the calling process.


    PUBLIC sPassedName as String

    Private Sub Form_Load()
    if (me.sPassedname = "Babelfish") then
    Msgbox "You are awsome!!!"
    Endif
    End Sub



    public sub Main()
    form1.sPassedName = "Babelfish"
    form1.show vbmodal
    end sub


    -- Why would you want to do that with an API? Just Wondering.


    babelfish.
    [email protected]

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