SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 1999
    Location
    Southampton, Hants, UK
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hope this is the right forum,

    In visual Basic I am trying to pass a variable from one form to another, I have no idea how to do it, unless putting it into a public variable (which I really don't want to do), I would like to pass it as you would with a function: ie

    functionname(variable1, var2, var3) and so on

    I'm sure there is a way to do it with forms:

    form1.show(var1, var2, var) but cannot get it to work?

    any suggestions? I'm sure it is really easy - but I am a bit slow

    cheers
    from DAN

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can't pass variables that way. You need to place the values into objects on the second form.


    From form1
    Code:
    form2.load
    form2.object1.value = variable1
    form2.object2.value = variable2
    If they are text boxes you need to give them focus first so you might want to make sure the form is hidden before hand so there is no flickering.
    Wayne Luke
    ------------



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •