Refer to control on another form

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Hello All:

I have recently upgraded to VB .Net 2003 from VB6 and am
having a little trouble.

I have a MDI parent form that has a frame on it with a
list box on the frame. I open an MDI child form and the
frame on the parent form is still visible. What I want to
do is run an OLEDBCommand on the child form and use the
value of the item selected in the list on the parent form
as a parameter when the user clicks a button. I tried the
following but it doesn't work.

Sub On_Click
Dim frm as Form1 'this is the parent form
Dim ListValue as Integer

ListValue=frm.listbox1.SelectedValue("ID")
 
Jeff said:
Hello All:

I have recently upgraded to VB .Net 2003 from VB6 and am
having a little trouble.

I have a MDI parent form that has a frame on it with a
list box on the frame. I open an MDI child form and the
frame on the parent form is still visible. What I want to
do is run an OLEDBCommand on the child form and use the
value of the item selected in the list on the parent form
as a parameter when the user clicks a button. I tried the
following but it doesn't work.

Sub On_Click
Dim frm as Form1 'this is the parent form
Dim ListValue as Integer

frm = ctype(me.mdiParent, form1)
 
Back
Top