By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

how to pass value from one form to another form

P: 13
Im using VB 6.0

The problem is have two forms the the first one (name it Form1) include one textbox control and button , and when pressing button I want to pass the textbox value to another text control in the second form (name it Form2). Please help me. Thanks
Sep 5 '07 #1
Share this Question
Share on Google+
4 Replies


hariharanmca
100+
P: 1,977
Im using VB 6.0

The problem is have two forms the the first one (name it Form1) include one textbox control and button , and when pressing button I want to pass the textbox value to another text control in the second form (name it Form2). Please help me. Thanks

Expand|Select|Wrap|Line Numbers
  1. frmFromValueCallName.ctrlName.Text = Me.ctrlName.Text
I think this will help you
Sep 5 '07 #2

QVeen72
Expert 100+
P: 1,445
Hi,

It is :

Expand|Select|Wrap|Line Numbers
  1. Form2.Text1.Text = Me.Text1.Text
  2.  
REgards
Veena
Sep 5 '07 #3

sgrec7
P: 59
i think this might be what your after:

Expand|Select|Wrap|Line Numbers
  1.  
  2. (form1)
  3.  
  4. private sub command1_click ()
    me.hide
    form2.show
    form2.textbox1.text = me.textbox1.text
    end sub
  5.  
  6. (form2)
  7.  
  8. private sub command1_click ()
    me.hide
    form1.show
    form1.textbox1.text = me.textbox1.text
    end sub
  9.  
  10.  
that should work for what your after (notice that that is two separate form's codes, not two separate sub's

that will; on the click, hide form1, show form 2, the text in form1 will = the text in form2, and visa versa

(you might need to change the names of some objects)

sgrec7
Sep 5 '07 #4

P: 13
Thank you guys for the help....
Sep 6 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.