Pass values from one form to another

Asked

Viewed 1,621 times

0

Expensive

I have two A and B forms.

A = Has listview and displays base information

B = Need to receive form A information and display. (Information that is not displayed in form A)

I need to make it happen through the listview_DblClick event()

  • Some information is missing from your question but see if you can call form A within form B

  • Ex: Textbox1.Text = Form.Combobox1.Text

  • And what you’ve tried so far?

  • - Check how Userforms are declared, for example: Userform2.TextBox1 = Userform1.TexBox1.Value . - And you will need to declare global variables. - The two are not opened simultaneously, unless used Vbmodeless.

2 answers

0

Dear I couldn’t access my other account;

@Marco

I’m just trying to figure out how I’m gonna do it;

I’m testing store the column value I need in variables (there are many);

    For i = 2 To LinhaFinal
    Set Item = ListView1.ListItems.Add(Text:=Plan3.Cells(i, 1))
    Item.SubItems(1) = Plan3.Cells(i, 2)
    Item.SubItems(2) = Plan3.Cells(i, 3)
    Item.SubItems(3) = Plan3.Cells(i, 4)
    Item.SubItems(4) = Plan3.Cells(i, 5)
    Item.SubItems(5) = Plan3.Cells(i, 6)
    Item.SubItems(6) = Plan3.Cells(i, 7)
    Item.SubItems(7) = Plan3.Cells(i, 8)
    Item.SubItems(8) = Plan3.Cells(i, 69)
    Item.SubItems(9) = Plan3.Cells(i, 70)
    Item.SubItems(10) = Plan3.Cells(i, 71)
    Item.SubItems(11) = Plan3.Cells(i, 72)
    teste = Plan3.Cells(i, 67)

Next

I intend to pass this variable "test" to the other form, because there I have to display on an optionButton (same amount of variables).

  • 2

    Contact the SE via the following link and request to "merge" the two accounts so you can get control of the contents of the old https://answall.com/contact

  • @Articuno thanks, I already sent the request.

  • I don’t think I’ll be able to do that part inside the FOR. .

0


Expensive

Can do it that way:

In form B I will use the following code

formA.ListView1.SelectedItem.SubItems(x)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.