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

picking and saving a value between two forms

P: 3
Visual Basic6.0 Coding Help

My Operating system is WindowsXP
I am working on my current project in vb6.0.

My problems are as follows.
1. I want a textbox of one form(form2) to pick a value to be used in this form from another database table of another form(form1)

2. I want to update a value from one textbox in one form to the database table of another form
Mar 19 '07 #1
Share this Question
Share on Google+
2 Replies

P: 17
For problem 1:
Database control
Use a Data control and connect it to the database, then with the text box select the data properties on the control and put them as required.
Form - From
Have the code on the form where you want the values to display be like:
Expand|Select|Wrap|Line Numbers
  1. Form1.Text1.Text = Form2.Text1.Text
That will made a text box on form 1 have the same caption as a text box on form 2.

For problem 2:
Again use the data control. This time:
Expand|Select|Wrap|Line Numbers
  1. Data1.Recordset.Edit
  2. 'or you can use
  3. Data1.Recordset.Addnew
  4. Data1.Recordset.Fields("TableName") = Text1.Text
  5. Data1.Recordset.Update
Mar 19 '07 #2

P: 1,646
What kind of project is this? Is it one you are studying?
Mar 19 '07 #3

Post your reply

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