473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to read text from childMdi form textbox?

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
16 3829
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
16
by: Adda | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.