Results 1 to 4 of 4

Thread: Passing parameters

  1. #1
    Guest

    Question

    How can i pass variables from one form to another??

  2. #2
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    If you only need to pass the variables into one function in a form you can set up that function to accept variables

    Public Sub Edit(var1 as long, var2 as variant)
    '
    End Sub

    If you need to change the values of these variables within this function you shoul pass them 'ByRef'. If however you will need to acces them throughout both forms then you are better off adding a module to your project and setting up the variables in the module as Global.

  3. #3
    Guest

    MAKAI post in another forum

    perhaps you want to declare a variable as Public in a code module

    Project->Add Module

    'example - only one line needed in the module
    Public myVar as Integer

    then you can use myVar in all forms in a project

  4. #4
    Lively Member
    Join Date
    Jun 2000
    Location
    A caravan park in the Midlands (UK)
    Posts
    101
    Could always use PUBLIC PROPERTY GETs & LETs. At least it'll keep consistency with any classes that way.
    Anakim

    It's a small world but I wouldn't like to paint it.

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