Hi,
You need a reference to the form base to access its members.
Here is a possible solution. Add this to the form base.
Private Shared frm As base
Public Shared ReadOnly Property DefInstance() As base
Get
If frm Is Nothing Then frm = New base
Return frm
End Get
End Property
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
frm = Me
End Sub
Use it this way.
equation = base.definstance.qc_a.Text()
Ken
--------------------
"Xero" <jeff_@_chezjeff_._net(remove_underscores_and_this )> wrote in message
news:C2**********************************@microsof t.com...
Hello. I am using vb.net.
There are two forms in my project. One is 'base' and the other one is
'savecurrent'.
There is a value stored in a textbox called 'qc_a' in 'base'. I want to
inherit it in 'savecurrent' when a button (located in 'savecurrent') is
clicked. So a declared an Object varible, whose name is 'equation' in
'savecurrent' and typed in the following code:
equation = base.qc_a.Text()
Then VB underlined 'base.qc_a' and said 'Reference to a non-shared member
requires an object reference'.
Could anybody tell me how to fix this? Thanks.
--
Xero
http://www.chezjeff.net
My personal web portal