Refresh combo from another form

Cassio

Well-known member
Joined
Nov 30, 2002
Messages
276
Location
Rio de Janeiro
Hi! I have a MDI app and I need to refresh a combolist from form1 when I press the update button on form2. I have a Sub to populate the combo, and it works only when I call it from within the form1 code. When I call it from another form it doesnt refresh the combo.
Here
 
You created a new instance of form1 on your form2 when you:
Code:
Dim f as New Form1
thus you will never update your original combo on form1.

Who creates the instance of Form2? The MDI parent or Form1?
A reference to either Form1 or the combobox must be passed into form2 at some point, in order for you to fire your sub.
 
Problem solved.
Just declared the frmCompras (in the MDI Parent) as Public Shared and its Subs and Functions could be accessed from anywhere.
 
Back
Top