locked
copying text from one form to another in textboxes RRS feed

  • Question

  • (using vb 2008 express) 

    hey i need help transfering the contents of:

     

    textbox1.text on mainform

     

    to

     

    textbox2.text on secondary form

     

    i have tryed using methods i have looked up with google but this doesnt seem to do anything

     

    this is what i was told to use:

     

    Code Snippet

    Private Sub edititem_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim mainform As New Add_DeleteItem

    Me.txtedititemID.Text = mainform.txtfounditemID.Text

     

     

    this doesnt seem to do anything. no data appears in to new form at all. should this work?

    there are no errors from this.

     

    can anyone help me with this please. the simpler the solution the better as i am a novice. thanks!

    Saturday, April 19, 2008 8:21 PM

Answers

  • Looks like you are copying from form you just created (mainForm) to an existin form.  I think you need to reverse direction? mainform.txtfounditemID.Text = Me.txtedititemID.Text

     

     

    Saturday, April 19, 2008 9:21 PM

All replies

  • Looks like you are copying from form you just created (mainForm) to an existin form.  I think you need to reverse direction? mainform.txtfounditemID.Text = Me.txtedititemID.Text

     

     

    Saturday, April 19, 2008 9:21 PM
  • thanks very much for that answer... its helped alot

    sorry for late reply  just switched broaband provider over the week so been down for a bit.

    cheers

    Thursday, April 24, 2008 9:06 AM