picking and saving a value between two forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zishiri
    New Member
    • Mar 2007
    • 3

    picking and saving a value between two forms

    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
  • Geoff
    New Member
    • Feb 2007
    • 17

    #2
    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:
    Code:
    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:
    Code:
    Data1.Recordset.Edit
    'or you can use
    Data1.Recordset.Addnew
    Data1.Recordset.Fields("TableName") = Text1.Text
    Data1.Recordset.Update

    Comment

    • willakawill
      Top Contributor
      • Oct 2006
      • 1646

      #3
      What kind of project is this? Is it one you are studying?

      Comment

      Working...