Today i’m trying to pass a variable between two datagrids.
The first is on an main form, and the second is in a dialog form.
I tried using functions and also through public variables like this:
Invoice_new (Parent FORM):
Controls:
DatagridView: invoice_items
Public WriteOnly Property ValueFromChild() As String
Set(ByVal Value As String)
MsgBox(Value) 'Work
With Me.invoice_items
.Rows.Add() 'Does not WORK
.Item(0, 0).Value() = Value 'Does not WORK
End With
End Set
End Property
invoice_new_search_item (Child FORM)
Controls:
DatagridView: search_items
invoice_new.ValueFromChild() = search_items.Item(0, current_row).Value
I tried many ways to do this but I can not any solution, someone give me some idea to do this would be really grateful.
You could use delegates to pass information between a main form and dialog form. For instance your variable to be used in both datagrids. I’d give this a quick google.
A Beginner’s Guide to Delegates
Hope this is helpful and what you are looking for.