+ Reply to Thread
Results 1 to 4 of 4

How to Transfer TextBox Value from 1st Form to 2nd Form at TextBox

Hybrid View

  1. #1
    Registered User
    Join Date
    09-28-2018
    Location
    Quebec, Canada
    MS-Off Ver
    Excel 365
    Posts
    11

    How to Transfer TextBox Value from 1st Form to 2nd Form at TextBox

    Need Help! I have a form in VBA Excel, I need to automatically transfer the value of my scanned qr code to 2nd form (kindly see attached snapshot for clarity). I will need code for this. Thanks, I hope some one will help me in this problem! Thank you in advance.Form_Scan.JPG
    Last edited by RBMAGBANUA; 06-23-2023 at 11:05 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: How to Transfer TextBox Value from 1st Form to 2nd Form at TextBox

    You need to setup a variable to store the value between the UserForms.

    Assumption: UserForms are called UserForm1 & UserForm2, The input fields are called TextBox1 in both UserForms. Amend code to suit your requirements.


    In UserForm1

    Private Sub CommandButton1_Click()
        MyVal = TextBox1.Value
        UserForm2.Show
        Unload Me
    End Sub
    In UserForm2

    Private Sub UserForm_Initialize()
        TextBox1.Value = MyVal
    End Sub
    Declare variable in a standard Module

    Public MyVal
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

  3. #3
    Registered User
    Join Date
    09-28-2018
    Location
    Quebec, Canada
    MS-Off Ver
    Excel 365
    Posts
    11

    Re: How to Transfer TextBox Value from 1st Form to 2nd Form at TextBox

    Thank you so much Mr. ORoos... it works! I really glad that you helped me... Thank you Thank you much again!

  4. #4
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: How to Transfer TextBox Value from 1st Form to 2nd Form at TextBox

    You are welcome

    ...and thanks for the rep!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel VBA form - textbox to export data over 255 characters from textbox
    By DannyJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2017, 05:52 AM
  2. [SOLVED] vba: copy value of textbox to another textbox in another form
    By saikong051 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-13-2014, 04:05 PM
  3. [SOLVED] Form w/ Textbox/Radio buttons/Checkbox and button to transfer to 2nd sheet as database
    By christlivethinme in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2013, 02:24 PM
  4. Transfer String Data from Textbox to Textbox
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-27-2011, 09:10 AM
  5. end down option in a textbox of a form
    By DTGvet in forum Excel General
    Replies: 1
    Last Post: 06-15-2006, 09:10 AM
  6. Form TextBox Transfer to Spreadsheet
    By Excellant in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2005, 02:39 PM
  7. TextBox on a Form How do I.......?
    By Casey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2005, 12:27 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1