Controls in other forms

JEvansCdc

New member
Joined
Dec 4, 2006
Messages
1
Programming Experience
10+
I seem to be having an issue with what is hopefully a quick solution. All I want to do is change the text of a label on another form. What I have is an MDI interface. I open the data management window then I open up the search window. When the user selects the record in the search window, I want the record name to be updated in a label which is located on the data management window. The syntax I use is:

My.Forms.frmDataMgmt.lblName.Text = "Bob Smith"

I don't get any exceptions when the code executes, but the label text is never updated.
 
If you bring up the frmDataMgmt with this syntax

frmDataMgmt.show()

You should be able to set the label with no problems. If you bring up the frmDataMgmt with this syntax

Dim newFrm as frmDataMgmt = new frmDataMgmt
newFrm.show()

I think you won't be able to use

My.Forms.frmDataMgmt.lblName.Text = "Bob Smith"

There are few ways to solve this, display your search form as modal form, and set the value after the search form hiding.
 
Back
Top