Results 1 to 6 of 6

Thread: Getting info from another form

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35
    Ok heres my problem... I have 2 forms.
    A login form with the (txtUserName and txtPassword)
    and a Main form. (frmLogin and Form1)

    On Form1 I have label1 at the top...how do I set it up so that whatever is written in txtUserName on the frmLogin, appears in Label1 on Form1?

    Thanks

  2. #2
    Addicted Member cwm's Avatar
    Join Date
    Mar 2000
    Posts
    133
    "how do I set it up so that whatever is written in txtUserName on the frmLogin, appears in Label1 on Form1?"

    (in the form with Label1)
    Label1 = Form1.txtUserName

  3. #3
    Registered User Lior's Avatar
    Join Date
    Jan 2000
    Posts
    307
    Just try:
    Form1.Label1=frmLogin.txtUserName

    Lior, An Israeli Programmer.

  4. #4
    Addicted Member cwm's Avatar
    Join Date
    Mar 2000
    Posts
    133
    Label1 = frmLogin.txtUserName

    i had it backwards

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35
    Ok I figured it out. Thanx
    I had to set it up so when Ok was pressed it made the label1.Caption set to the txtUserName. Thanks again!

  6. #6
    Lively Member
    Join Date
    Nov 1999
    Location
    Melbourne, Victoria, Australia
    Posts
    126
    You can also reference objects on other forms by using

    'Change a property
    FrmOther!MainWindowText.Text = "Blah"

    'Execute a function
    FrmOther!OpenCmd_Click
    Regards,

    Paul Rivoli
    ---------------------
    [email protected]
    http://members.dingoblue.net.au/~privoli

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