I’m trying to pass a variable from a child form that contains a DataGridView, I’m calling a function to do the action, but I can not succeed alone function gets the value but does not alter the form’s datagridview father, the code I’m using is:
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
See the CType Funcion: