Results 1 to 3 of 3

Thread: passing variables from one form to another

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Location
    Phoenix AZ. U.S.A
    Posts
    2

    Post

    this is a simple question I know but I'm having a total brain fart and cant seem to get it im trying to send a currency variable from one form to another and cant remember the syntax ect......please please please help!

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Posts
    219

    Post

    that easy here how you do it

    first off here whar you do

    Module1 Code
    Code:
    'in a Module put this
    public MyVar as string
    Command Button On Form1 Code
    Code:
    Sub Command1_Click()
    MyVar = Text1.text
    End Sub
    On Text1.text on form2 code
    on form2_load()
    Code:
    Sub Form2_Load()
    Text1.text = MyVar
    End Sub

  3. #3
    Addicted Member
    Join Date
    Jan 1999
    Location
    Sydney,NSW,Australia
    Posts
    178

    Post

    Ok two possibilities

    if the currency field is declared within code, ie not a vb control then declare it as global

    Global gcCurrency as Currency

    If the currency field is a vb control then

    within frm1 do

    Load frm2
    frm2.CurrencyObject = whatever the name of the control is in frm1

    Hope i helps

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