Results 1 to 7 of 7

Thread: how do you transfer variables from form to form?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    I want to transfer variables from one form to another keeping the values, is there a better way than using text boxes to do it?
    Ian Callanan
    VB6.0
    [email protected]

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655

    Wink

    A much better way!

    Place the following in a module:

    Code:
    Global myVar as String 'or whatever you want it to be called
    Change the information accordingly. But all you have to do is where your telling the form to pull the vars value, use the vars name rather than the text box that I assume you're using now.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    no i posted before i tried(thank god i did, i have over 50 variables probly to transfer back and forth)

    i tried dim in a module but thank you for helping
    Ian Callanan
    VB6.0
    [email protected]

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb registry

    may be you can keep it in the registry? with the 2 simple function bundle with VB. SaveSetting and GetSetting

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    i know about using the registry, but for what I am doing the global declarations is MUCH better(you have no idea how happy it made me to find it THIS easy to do so(yahoo)(id use exclamation point but my one - four keys above the keys are broken quite annoying, not that you cared, hehehehehe)
    Ian Callanan
    VB6.0
    [email protected]

  6. #6
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Question

    If the four key is broken, then may be you can use the underscore _ to join them together, so end up you still can make use the registry to store all your variable.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    i meant all the keys(one, two, three, and four) are broken not just four(i can use the numpad for numbers(quite annoying in VB), and char map for the at sign etc, but relaly annoying)

    anything this could be beyond hardware?
    Ian Callanan
    VB6.0
    [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