Consulting

Results 1 to 9 of 9

Thread: Transfering data form to form

  1. #1

    Transfering data form to form

    Hiya People

    Jusr wondering how I can transfer data between forms, .e.g taking data from a text box and placing in into another text box on a form?

    thanks.

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Guessing that you mean another textbox on a different form:
    [VBA]
    Me.TextBox1.Text = UserForm1.TextBox1.Text
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Thanks, looks like it works, however I want all the info to automatically appear on the new form, rather that clicking a button to display the information.

    Would I need to use something like

    Private Sub tTextbox1_AfterUpdate

    or something similar?

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Bopo.
    How are you opening the new form?
    Data can be added to it using the Userform Initialize event. Do you anticipate entering data on the spreadsheet while a Userform is displayed?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Quote Originally Posted by mdmackillop
    Hi Bopo.
    How are you opening the new form?
    Data can be added to it using the Userform Initialize event. Do you anticipate entering data on the spreadsheet while a Userform is displayed?
    Erm okay....


    Bascially a user in going to fill details into a form, such as name, costs etc, then a button on this form will be clicked, which will open a new form and display some of the details from the previous form for verication purposes and results of calculations will also appear on the form.

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You could possibly use a multipage control on the form, rather than multiple forms.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    Anyway, I have put it behind a button, no problems. however anthoer question

    I want to add data from 2text boxes into on another 1 lstbox, how do I do this?

  8. #8
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Here's a simple example
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  9. #9

    thanks

    thanks

Posting Permissions

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