By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 2,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

how to read text from childMdi form textbox?

P: n/a
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --

console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)

But if I have a sub in the Parent form and reference a
child mdi form like this:

Sub ReadText()
Dim frm As New Form2
console.writeline(frm.txt1.text)
End Sub

--I can't read the text in the textbox of the child form.
How could I read the text in a textbox of a child mdi form
from a sub in the parent form?

TIA
Adda
Nov 20 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
Hi,

Dim frmChild As Form2

For Each frmChild In Me.MdiChildren

Debug.WriteLine(frmChild.TextBox1.Text)

Next

Ken

---------------------

"Adda" <an*******@discussions.microsoft.com> wrote in message
news:19*****************************@phx.gbl...
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --

console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)

But if I have a sub in the Parent form and reference a
child mdi form like this:

Sub ReadText()
Dim frm As New Form2
console.writeline(frm.txt1.text)
End Sub

--I can't read the text in the textbox of the child form.
How could I read the text in a textbox of a child mdi form
from a sub in the parent form?

TIA
Adda

Nov 20 '05 #2

P: n/a
Hi,

Dim frmChild As Form2

For Each frmChild In Me.MdiChildren

Debug.WriteLine(frmChild.TextBox1.Text)

Next

Ken

---------------------

"Adda" <an*******@discussions.microsoft.com> wrote in message
news:19*****************************@phx.gbl...
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --

console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)

But if I have a sub in the Parent form and reference a
child mdi form like this:

Sub ReadText()
Dim frm As New Form2
console.writeline(frm.txt1.text)
End Sub

--I can't read the text in the textbox of the child form.
How could I read the text in a textbox of a child mdi form
from a sub in the parent form?

TIA
Adda

Nov 20 '05 #3

P: n/a
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I
can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but
the new row doesn't show up in the datagrid on the parent
form until after I do a dataset.clear, dataAdatapter.Fill
(dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the
new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?

Thank you again for your reply.
Adda

-----Original Message-----
Hi,

Dim frmChild As Form2

For Each frmChild In Me.MdiChildren

Debug.WriteLine(frmChild.TextBox1.Text)

Next

Ken

---------------------

"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:19*****************************@phx.gbl...
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --

console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)

But if I have a sub in the Parent form and reference a
child mdi form like this:

Sub ReadText()
Dim frm As New Form2
console.writeline(frm.txt1.text)
End Sub

--I can't read the text in the textbox of the child form. How could I read the text in a textbox of a child mdi form from a sub in the parent form?

TIA
Adda

.

Nov 20 '05 #4

P: n/a
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I
can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but
the new row doesn't show up in the datagrid on the parent
form until after I do a dataset.clear, dataAdatapter.Fill
(dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the
new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?

Thank you again for your reply.
Adda

-----Original Message-----
Hi,

Dim frmChild As Form2

For Each frmChild In Me.MdiChildren

Debug.WriteLine(frmChild.TextBox1.Text)

Next

Ken

---------------------

"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:19*****************************@phx.gbl...
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --

console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)

But if I have a sub in the Parent form and reference a
child mdi form like this:

Sub ReadText()
Dim frm As New Form2
console.writeline(frm.txt1.text)
End Sub

--I can't read the text in the textbox of the child form. How could I read the text in a textbox of a child mdi form from a sub in the parent form?

TIA
Adda

.

Nov 20 '05 #5

P: n/a
Hi,

post your code.

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in message
news:16*****************************@phx.gbl...
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I
can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but
the new row doesn't show up in the datagrid on the parent
form until after I do a dataset.clear, dataAdatapter.Fill
(dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the
new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?

Thank you again for your reply.
Adda

-----Original Message-----
Hi,

Dim frmChild As Form2

For Each frmChild In Me.MdiChildren

Debug.WriteLine(frmChild.TextBox1.Text)

Next

Ken

---------------------

"Adda" <an*******@discussions.microsoft.com> wrote in

message
news:19*****************************@phx.gbl...
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --

console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)

But if I have a sub in the Parent form and reference a
child mdi form like this:

Sub ReadText()
Dim frm As New Form2
console.writeline(frm.txt1.text)
End Sub

--I can't read the text in the textbox of the child form. How could I read the text in a textbox of a child mdi form from a sub in the parent form?

TIA
Adda

.

Nov 20 '05 #6

P: n/a
Hi,

post your code.

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in message
news:16*****************************@phx.gbl...
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I
can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but
the new row doesn't show up in the datagrid on the parent
form until after I do a dataset.clear, dataAdatapter.Fill
(dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the
new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?

Thank you again for your reply.
Adda

-----Original Message-----
Hi,

Dim frmChild As Form2

For Each frmChild In Me.MdiChildren

Debug.WriteLine(frmChild.TextBox1.Text)

Next

Ken

---------------------

"Adda" <an*******@discussions.microsoft.com> wrote in

message
news:19*****************************@phx.gbl...
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --

console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)

But if I have a sub in the Parent form and reference a
child mdi form like this:

Sub ReadText()
Dim frm As New Form2
console.writeline(frm.txt1.text)
End Sub

--I can't read the text in the textbox of the child form. How could I read the text in a textbox of a child mdi form from a sub in the parent form?

TIA
Adda

.

Nov 20 '05 #7

P: n/a
Sorry, had to step away for a couple of hours. Not at my
desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
....
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
....
----------------------------------------------
--in the Child Form---------------------------
....
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I
could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform
it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

-----Original Message-----
Hi,

post your code.

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:16*****************************@phx.gbl...
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but the new row doesn't show up in the datagrid on the parent form until after I do a dataset.clear, dataAdatapter.Fill (dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?
Thank you again for your reply.
Adda

>-----Original Message-----
>Hi,
>
>Dim frmChild As Form2
>
>For Each frmChild In Me.MdiChildren
>
>Debug.WriteLine(frmChild.TextBox1.Text)
>
>Next
>
>
>
>Ken
>
>---------------------
>
>"Adda" <an*******@discussions.microsoft.com> wrote in

message
>news:19*****************************@phx.gbl...
>> If I cycle through the MdiChildActivate event of the
>> parent form I can read text in a textbox on the child
>> mdiform --
>>
>> console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)
>>
>> But if I have a sub in the Parent form and reference a >> child mdi form like this:
>>
>> Sub ReadText()
>> Dim frm As New Form2
>> console.writeline(frm.txt1.text)
>> End Sub
>>
>> --I can't read the text in the textbox of the child

form.
>> How could I read the text in a textbox of a child mdi

form
>> from a sub in the parent form?
>>
>> TIA
>> Adda
>
>
>.
>

.

Nov 20 '05 #8

P: n/a
Sorry, had to step away for a couple of hours. Not at my
desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
....
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
....
----------------------------------------------
--in the Child Form---------------------------
....
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I
could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform
it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

-----Original Message-----
Hi,

post your code.

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:16*****************************@phx.gbl...
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but the new row doesn't show up in the datagrid on the parent form until after I do a dataset.clear, dataAdatapter.Fill (dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?
Thank you again for your reply.
Adda

>-----Original Message-----
>Hi,
>
>Dim frmChild As Form2
>
>For Each frmChild In Me.MdiChildren
>
>Debug.WriteLine(frmChild.TextBox1.Text)
>
>Next
>
>
>
>Ken
>
>---------------------
>
>"Adda" <an*******@discussions.microsoft.com> wrote in

message
>news:19*****************************@phx.gbl...
>> If I cycle through the MdiChildActivate event of the
>> parent form I can read text in a textbox on the child
>> mdiform --
>>
>> console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)
>>
>> But if I have a sub in the Parent form and reference a >> child mdi form like this:
>>
>> Sub ReadText()
>> Dim frm As New Form2
>> console.writeline(frm.txt1.text)
>> End Sub
>>
>> --I can't read the text in the textbox of the child

form.
>> How could I read the text in a textbox of a child mdi

form
>> from a sub in the parent form?
>>
>> TIA
>> Adda
>
>
>.
>

.

Nov 20 '05 #9

P: n/a
Hi,

Try rebinding the datagrid. Datagrid1.Datasource = ds.tables(0)

Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in message
news:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at my
desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I
could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform
it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

-----Original Message-----
Hi,

post your code.

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in

message
news:16*****************************@phx.gbl...
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but the new row doesn't show up in the datagrid on the parent form until after I do a dataset.clear, dataAdatapter.Fill (dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?
Thank you again for your reply.
Adda
>-----Original Message-----
>Hi,
>
>Dim frmChild As Form2
>
>For Each frmChild In Me.MdiChildren
>
>Debug.WriteLine(frmChild.TextBox1.Text)
>
>Next
>
>
>
>Ken
>
>---------------------
>
>"Adda" <an*******@discussions.microsoft.com> wrote in
message
>news:19*****************************@phx.gbl...
>> If I cycle through the MdiChildActivate event of the
>> parent form I can read text in a textbox on the child
>> mdiform --
>>
>> console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)
>>
>> But if I have a sub in the Parent form and reference a >> child mdi form like this:
>>
>> Sub ReadText()
>> Dim frm As New Form2
>> console.writeline(frm.txt1.text)
>> End Sub
>>
>> --I can't read the text in the textbox of the child
form.
>> How could I read the text in a textbox of a child mdi
form
>> from a sub in the parent form?
>>
>> TIA
>> Adda
>
>
>.
>

.

Nov 20 '05 #10

P: n/a
Hi,

Try rebinding the datagrid. Datagrid1.Datasource = ds.tables(0)

Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in message
news:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at my
desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I
could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform
it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

-----Original Message-----
Hi,

post your code.

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in

message
news:16*****************************@phx.gbl...
Thank you. I also discovered that if I declare the
childform at the Form level of the Parent form as shared I can also read the text in the textbox.

While I am at it, what I am actually trying to do is to
refresh a datagrid on the parent form with data that I
enter in the child form. I pass a datarow object to the
child and populate it and then update the dataset with a
dataAdapter (using a button on the childform or an Add
menu selection from the parent form). This works fine but the new row doesn't show up in the datagrid on the parent form until after I do a dataset.clear, dataAdatapter.Fill (dataset, "tbl1") on the parent form from a menu event o
the Parent. Could you suggest a way that I could make the new row show up in the datagrid when in the same event
that I update the dataset with the data from the childform?
Thank you again for your reply.
Adda
>-----Original Message-----
>Hi,
>
>Dim frmChild As Form2
>
>For Each frmChild In Me.MdiChildren
>
>Debug.WriteLine(frmChild.TextBox1.Text)
>
>Next
>
>
>
>Ken
>
>---------------------
>
>"Adda" <an*******@discussions.microsoft.com> wrote in
message
>news:19*****************************@phx.gbl...
>> If I cycle through the MdiChildActivate event of the
>> parent form I can read text in a textbox on the child
>> mdiform --
>>
>> console.writeline(Me.ActiveMdiChild.Controls(1).Te xt)
>>
>> But if I have a sub in the Parent form and reference a >> child mdi form like this:
>>
>> Sub ReadText()
>> Dim frm As New Form2
>> console.writeline(frm.txt1.text)
>> End Sub
>>
>> --I can't read the text in the textbox of the child
form.
>> How could I read the text in a textbox of a child mdi
form
>> from a sub in the parent form?
>>
>> TIA
>> Adda
>
>
>.
>

.

Nov 20 '05 #11

P: n/a
I did try that, but still the datagrid on the parent form
did not refresh on dataAdapter.Update call. I also tried
using a separate thread (from the child form). The only
way the datagrid would refresh on the dataAdapter.Update
call is if I added the new data in the parent form
(hardcoded data for now). This is why I was trying to
read the data from the childform to the parent form. I am
sure there is a way to refresh the datagrid from the
childform - just obscure right now.

Any suggestions welcome. And thank you again for all your
replies.

Adda
-----Original Message-----
Hi,

Try rebinding the datagrid. Datagrid1.Datasource = ds.tables(0)
Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at my desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

>-----Original Message-----
>Hi,
>
> post your code.
>
>Ken
>-----------
>"Adda" <an*******@discussions.microsoft.com> wrote in

message
>news:16*****************************@phx.gbl...
>> Thank you. I also discovered that if I declare the
>> childform at the Form level of the Parent form as

shared I
>> can also read the text in the textbox.
>>
>> While I am at it, what I am actually trying to do is to >> refresh a datagrid on the parent form with data that I >> enter in the child form. I pass a datarow object to the >> child and populate it and then update the dataset with a >> dataAdapter (using a button on the childform or an Add >> menu selection from the parent form). This works fine
but
>> the new row doesn't show up in the datagrid on the

parent
>> form until after I do a dataset.clear,

dataAdatapter.Fill
>> (dataset, "tbl1") on the parent form from a menu
event o >> the Parent. Could you suggest a way that I could make the
>> new row show up in the datagrid when in the same
event >> that I update the dataset with the data from the

childform?
>>
>> Thank you again for your reply.
>> Adda
>>
>>
>> >-----Original Message-----
>> >Hi,
>> >
>> >Dim frmChild As Form2
>> >
>> >For Each frmChild In Me.MdiChildren
>> >
>> >Debug.WriteLine(frmChild.TextBox1.Text)
>> >
>> >Next
>> >
>> >
>> >
>> >Ken
>> >
>> >---------------------
>> >
>> >"Adda" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:19*****************************@phx.gbl...
>> >> If I cycle through the MdiChildActivate event of the >> >> parent form I can read text in a textbox on the child >> >> mdiform --
>> >>
>> >> console.writeline(Me.ActiveMdiChild.Controls (1).Text) >> >>
>> >> But if I have a sub in the Parent form and reference a
>> >> child mdi form like this:
>> >>
>> >> Sub ReadText()
>> >> Dim frm As New Form2
>> >> console.writeline(frm.txt1.text)
>> >> End Sub
>> >>
>> >> --I can't read the text in the textbox of the

child >> form.
>> >> How could I read the text in a textbox of a child mdi >> form
>> >> from a sub in the parent form?
>> >>
>> >> TIA
>> >> Adda
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 20 '05 #12

P: n/a
I did try that, but still the datagrid on the parent form
did not refresh on dataAdapter.Update call. I also tried
using a separate thread (from the child form). The only
way the datagrid would refresh on the dataAdapter.Update
call is if I added the new data in the parent form
(hardcoded data for now). This is why I was trying to
read the data from the childform to the parent form. I am
sure there is a way to refresh the datagrid from the
childform - just obscure right now.

Any suggestions welcome. And thank you again for all your
replies.

Adda
-----Original Message-----
Hi,

Try rebinding the datagrid. Datagrid1.Datasource = ds.tables(0)
Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at my desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

>-----Original Message-----
>Hi,
>
> post your code.
>
>Ken
>-----------
>"Adda" <an*******@discussions.microsoft.com> wrote in

message
>news:16*****************************@phx.gbl...
>> Thank you. I also discovered that if I declare the
>> childform at the Form level of the Parent form as

shared I
>> can also read the text in the textbox.
>>
>> While I am at it, what I am actually trying to do is to >> refresh a datagrid on the parent form with data that I >> enter in the child form. I pass a datarow object to the >> child and populate it and then update the dataset with a >> dataAdapter (using a button on the childform or an Add >> menu selection from the parent form). This works fine
but
>> the new row doesn't show up in the datagrid on the

parent
>> form until after I do a dataset.clear,

dataAdatapter.Fill
>> (dataset, "tbl1") on the parent form from a menu
event o >> the Parent. Could you suggest a way that I could make the
>> new row show up in the datagrid when in the same
event >> that I update the dataset with the data from the

childform?
>>
>> Thank you again for your reply.
>> Adda
>>
>>
>> >-----Original Message-----
>> >Hi,
>> >
>> >Dim frmChild As Form2
>> >
>> >For Each frmChild In Me.MdiChildren
>> >
>> >Debug.WriteLine(frmChild.TextBox1.Text)
>> >
>> >Next
>> >
>> >
>> >
>> >Ken
>> >
>> >---------------------
>> >
>> >"Adda" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:19*****************************@phx.gbl...
>> >> If I cycle through the MdiChildActivate event of the >> >> parent form I can read text in a textbox on the child >> >> mdiform --
>> >>
>> >> console.writeline(Me.ActiveMdiChild.Controls (1).Text) >> >>
>> >> But if I have a sub in the Parent form and reference a
>> >> child mdi form like this:
>> >>
>> >> Sub ReadText()
>> >> Dim frm As New Form2
>> >> console.writeline(frm.txt1.text)
>> >> End Sub
>> >>
>> >> --I can't read the text in the textbox of the

child >> form.
>> >> How could I read the text in a textbox of a child mdi >> form
>> >> from a sub in the parent form?
>> >>
>> >> TIA
>> >> Adda
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 20 '05 #13

P: n/a
One other interesting thing I noticed if I add new data
from the parent form (which does successfully update and
refresh the datagrid as I desire) is that if I have
multiple childforms loaded, 1) I can only read data from
the forms if I loop through the childforms collection 2)
the data is read from each childform in the order that
each form is opened - like if I have child0, child1,
child2 I will pick up the data in child2 form from the
Parent form and then successfully update the dataset and
successfully refresh the datagrid.

I hope to find a way to refresh the datagrid in the parent
form from the the childform.
-----Original Message-----
Hi,

Try rebinding the datagrid. Datagrid1.Datasource = ds.tables(0)
Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at my desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

>-----Original Message-----
>Hi,
>
> post your code.
>
>Ken
>-----------
>"Adda" <an*******@discussions.microsoft.com> wrote in

message
>news:16*****************************@phx.gbl...
>> Thank you. I also discovered that if I declare the
>> childform at the Form level of the Parent form as

shared I
>> can also read the text in the textbox.
>>
>> While I am at it, what I am actually trying to do is to >> refresh a datagrid on the parent form with data that I >> enter in the child form. I pass a datarow object to the >> child and populate it and then update the dataset with a >> dataAdapter (using a button on the childform or an Add >> menu selection from the parent form). This works fine
but
>> the new row doesn't show up in the datagrid on the

parent
>> form until after I do a dataset.clear,

dataAdatapter.Fill
>> (dataset, "tbl1") on the parent form from a menu
event o >> the Parent. Could you suggest a way that I could make the
>> new row show up in the datagrid when in the same
event >> that I update the dataset with the data from the

childform?
>>
>> Thank you again for your reply.
>> Adda
>>
>>
>> >-----Original Message-----
>> >Hi,
>> >
>> >Dim frmChild As Form2
>> >
>> >For Each frmChild In Me.MdiChildren
>> >
>> >Debug.WriteLine(frmChild.TextBox1.Text)
>> >
>> >Next
>> >
>> >
>> >
>> >Ken
>> >
>> >---------------------
>> >
>> >"Adda" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:19*****************************@phx.gbl...
>> >> If I cycle through the MdiChildActivate event of the >> >> parent form I can read text in a textbox on the child >> >> mdiform --
>> >>
>> >> console.writeline(Me.ActiveMdiChild.Controls (1).Text) >> >>
>> >> But if I have a sub in the Parent form and reference a
>> >> child mdi form like this:
>> >>
>> >> Sub ReadText()
>> >> Dim frm As New Form2
>> >> console.writeline(frm.txt1.text)
>> >> End Sub
>> >>
>> >> --I can't read the text in the textbox of the

child >> form.
>> >> How could I read the text in a textbox of a child mdi >> form
>> >> from a sub in the parent form?
>> >>
>> >> TIA
>> >> Adda
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 20 '05 #14

P: n/a
One other interesting thing I noticed if I add new data
from the parent form (which does successfully update and
refresh the datagrid as I desire) is that if I have
multiple childforms loaded, 1) I can only read data from
the forms if I loop through the childforms collection 2)
the data is read from each childform in the order that
each form is opened - like if I have child0, child1,
child2 I will pick up the data in child2 form from the
Parent form and then successfully update the dataset and
successfully refresh the datagrid.

I hope to find a way to refresh the datagrid in the parent
form from the the childform.
-----Original Message-----
Hi,

Try rebinding the datagrid. Datagrid1.Datasource = ds.tables(0)
Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in messagenews:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at my desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda

>-----Original Message-----
>Hi,
>
> post your code.
>
>Ken
>-----------
>"Adda" <an*******@discussions.microsoft.com> wrote in

message
>news:16*****************************@phx.gbl...
>> Thank you. I also discovered that if I declare the
>> childform at the Form level of the Parent form as

shared I
>> can also read the text in the textbox.
>>
>> While I am at it, what I am actually trying to do is to >> refresh a datagrid on the parent form with data that I >> enter in the child form. I pass a datarow object to the >> child and populate it and then update the dataset with a >> dataAdapter (using a button on the childform or an Add >> menu selection from the parent form). This works fine
but
>> the new row doesn't show up in the datagrid on the

parent
>> form until after I do a dataset.clear,

dataAdatapter.Fill
>> (dataset, "tbl1") on the parent form from a menu
event o >> the Parent. Could you suggest a way that I could make the
>> new row show up in the datagrid when in the same
event >> that I update the dataset with the data from the

childform?
>>
>> Thank you again for your reply.
>> Adda
>>
>>
>> >-----Original Message-----
>> >Hi,
>> >
>> >Dim frmChild As Form2
>> >
>> >For Each frmChild In Me.MdiChildren
>> >
>> >Debug.WriteLine(frmChild.TextBox1.Text)
>> >
>> >Next
>> >
>> >
>> >
>> >Ken
>> >
>> >---------------------
>> >
>> >"Adda" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:19*****************************@phx.gbl...
>> >> If I cycle through the MdiChildActivate event of the >> >> parent form I can read text in a textbox on the child >> >> mdiform --
>> >>
>> >> console.writeline(Me.ActiveMdiChild.Controls (1).Text) >> >>
>> >> But if I have a sub in the Parent form and reference a
>> >> child mdi form like this:
>> >>
>> >> Sub ReadText()
>> >> Dim frm As New Form2
>> >> console.writeline(frm.txt1.text)
>> >> End Sub
>> >>
>> >> --I can't read the text in the textbox of the

child >> form.
>> >> How could I read the text in a textbox of a child mdi >> form
>> >> from a sub in the parent form?
>> >>
>> >> TIA
>> >> Adda
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 20 '05 #15

P: n/a
Hi,

Private Sub btnAdd(...)...
Dim frm As Parentfrm = Me.Parent
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in message
news:15*****************************@phx.gbl...
One other interesting thing I noticed if I add new data
from the parent form (which does successfully update and
refresh the datagrid as I desire) is that if I have
multiple childforms loaded, 1) I can only read data from
the forms if I loop through the childforms collection 2)
the data is read from each childform in the order that
each form is opened - like if I have child0, child1,
child2 I will pick up the data in child2 form from the
Parent form and then successfully update the dataset and
successfully refresh the datagrid.

I hope to find a way to refresh the datagrid in the parent
form from the the childform.
-----Original Message-----
Hi,

Try rebinding the datagrid. Datagrid1.Datasource

= ds.tables(0)

Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in

message
news:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at

my desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda
>-----Original Message-----
>Hi,
>
> post your code.
>
>Ken
>-----------
>"Adda" <an*******@discussions.microsoft.com> wrote in
message
>news:16*****************************@phx.gbl...
>> Thank you. I also discovered that if I declare the
>> childform at the Form level of the Parent form as
shared I
>> can also read the text in the textbox.
>>
>> While I am at it, what I am actually trying to do is to >> refresh a datagrid on the parent form with data that I >> enter in the child form. I pass a datarow object to the >> child and populate it and then update the dataset with a >> dataAdapter (using a button on the childform or an Add >> menu selection from the parent form). This works fine but
>> the new row doesn't show up in the datagrid on the
parent
>> form until after I do a dataset.clear,
dataAdatapter.Fill
>> (dataset, "tbl1") on the parent form from a menu event o >> the Parent. Could you suggest a way that I could make the
>> new row show up in the datagrid when in the same event >> that I update the dataset with the data from the
childform?
>>
>> Thank you again for your reply.
>> Adda
>>
>>
>> >-----Original Message-----
>> >Hi,
>> >
>> >Dim frmChild As Form2
>> >
>> >For Each frmChild In Me.MdiChildren
>> >
>> >Debug.WriteLine(frmChild.TextBox1.Text)
>> >
>> >Next
>> >
>> >
>> >
>> >Ken
>> >
>> >---------------------
>> >
>> >"Adda" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:19*****************************@phx.gbl...
>> >> If I cycle through the MdiChildActivate event of the >> >> parent form I can read text in a textbox on the child >> >> mdiform --
>> >>
>> >> console.writeline(Me.ActiveMdiChild.Controls (1).Text) >> >>
>> >> But if I have a sub in the Parent form and reference a
>> >> child mdi form like this:
>> >>
>> >> Sub ReadText()
>> >> Dim frm As New Form2
>> >> console.writeline(frm.txt1.text)
>> >> End Sub
>> >>
>> >> --I can't read the text in the textbox of the child >> form.
>> >> How could I read the text in a textbox of a child mdi >> form
>> >> from a sub in the parent form?
>> >>
>> >> TIA
>> >> Adda
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 20 '05 #16

P: n/a
Hi,

Private Sub btnAdd(...)...
Dim frm As Parentfrm = Me.Parent
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub

Ken
-----------
"Adda" <an*******@discussions.microsoft.com> wrote in message
news:15*****************************@phx.gbl...
One other interesting thing I noticed if I add new data
from the parent form (which does successfully update and
refresh the datagrid as I desire) is that if I have
multiple childforms loaded, 1) I can only read data from
the forms if I loop through the childforms collection 2)
the data is read from each childform in the order that
each form is opened - like if I have child0, child1,
child2 I will pick up the data in child2 form from the
Parent form and then successfully update the dataset and
successfully refresh the datagrid.

I hope to find a way to refresh the datagrid in the parent
form from the the childform.
-----Original Message-----
Hi,

Try rebinding the datagrid. Datagrid1.Datasource

= ds.tables(0)

Ken
----------
"Adda" <an*******@discussions.microsoft.com> wrote in

message
news:19*****************************@phx.gbl...
Sorry, had to step away for a couple of hours. Not at

my desk right now, but the code goes something like the
following:

--in the parent form--------------------

Public Class Parentfrm
Dim ddRow As DataRow
...
Public Property dRow() As DataRow
Get
Return ddRow
End Get
Set(ByVal Value As DataRow)
ddRow = Value
End Set
End Property

Public Sub AddRow()
dataset1.Tables("tbl1").Rows.Add(ddRow)
dataAdapter1.Update(dataset1, "tbl1")
Me.Refresh
'how to refresh datagrid1?
End Sub
...
----------------------------------------------
--in the Child Form---------------------------
...
Private Sub btnAdd(...)...
Dim frm As New Parentfrm
frm.dRow = frm.dataset1.Tables("tbl1").NewRow
frm.dRow(0) = txt0.Text
frm.dRow(1) = txt1.Text
frm.AddRow()
End Sub
-----------------------------------------------

tbl1 resides in a sql Server database. The data is
getting stored correctly. But the new row does not show
up in datagrid1 until I click on a menu event on the
parent form

---------------------------------------------
Private Sub mnuRefresh(...)...
dataset1.clear()
dataAdapter1.Fill(dataset1, "tbl1")
End Sub
-----------------------------------------------

now the new row shows up in datagrid1. I am hoping that I could accomplish this when I do dataAdapter.Update(...).
If I perform this operation from Parentfrm datagrid1
updates automatically. But if I do it from the childform it does not.

Any suggestions greatly appreciated on how to get
datagrid1 to update automatically when adding data from
the childform. Thank you very much for your help.

Adda
>-----Original Message-----
>Hi,
>
> post your code.
>
>Ken
>-----------
>"Adda" <an*******@discussions.microsoft.com> wrote in
message
>news:16*****************************@phx.gbl...
>> Thank you. I also discovered that if I declare the
>> childform at the Form level of the Parent form as
shared I
>> can also read the text in the textbox.
>>
>> While I am at it, what I am actually trying to do is to >> refresh a datagrid on the parent form with data that I >> enter in the child form. I pass a datarow object to the >> child and populate it and then update the dataset with a >> dataAdapter (using a button on the childform or an Add >> menu selection from the parent form). This works fine but
>> the new row doesn't show up in the datagrid on the
parent
>> form until after I do a dataset.clear,
dataAdatapter.Fill
>> (dataset, "tbl1") on the parent form from a menu event o >> the Parent. Could you suggest a way that I could make the
>> new row show up in the datagrid when in the same event >> that I update the dataset with the data from the
childform?
>>
>> Thank you again for your reply.
>> Adda
>>
>>
>> >-----Original Message-----
>> >Hi,
>> >
>> >Dim frmChild As Form2
>> >
>> >For Each frmChild In Me.MdiChildren
>> >
>> >Debug.WriteLine(frmChild.TextBox1.Text)
>> >
>> >Next
>> >
>> >
>> >
>> >Ken
>> >
>> >---------------------
>> >
>> >"Adda" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:19*****************************@phx.gbl...
>> >> If I cycle through the MdiChildActivate event of the >> >> parent form I can read text in a textbox on the child >> >> mdiform --
>> >>
>> >> console.writeline(Me.ActiveMdiChild.Controls (1).Text) >> >>
>> >> But if I have a sub in the Parent form and reference a
>> >> child mdi form like this:
>> >>
>> >> Sub ReadText()
>> >> Dim frm As New Form2
>> >> console.writeline(frm.txt1.text)
>> >> End Sub
>> >>
>> >> --I can't read the text in the textbox of the child >> form.
>> >> How could I read the text in a textbox of a child mdi >> form
>> >> from a sub in the parent form?
>> >>
>> >> TIA
>> >> Adda
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.