Results 1 to 7 of 7

Thread: [RESOLVED] dual forms

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    76

    Resolved [RESOLVED] dual forms

    if i have two forms or more. how do i grab a variable from form1 and use it in form2?

    thank you

    steve

  2. #2
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: dual forms

    In form1

    something = form2.variable_name

    Or In form2

    something = form1.variable_name
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    76

    Re: dual forms

    ah thanx

  4. #4

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: [RESOLVED] dual forms

    Has to be Public in the first form:

    form1:
    VB Code:
    1. Option Explicit
    2.  
    3. Public s$
    4.  
    5. Private Sub Form_Load()
    6.   s = Format(0.25, "#,0.00")
    7.   Form2.Show
    8. End Sub

    form2:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   MsgBox Form1.s
    5. End Sub

  6. #6
    Fanatic Member vbasicgirl's Avatar
    Join Date
    Jan 2004
    Location
    Manchester, UK
    Posts
    1,016

    Re: [RESOLVED] dual forms

    Or put the variable into a module.

    casey.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    76

    Re: [RESOLVED] dual forms

    thanx dglienna works perfectly now

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