Kerry,
Thanks for the help. After 40 years of programming in the older languages(C,
Fortran, Basic, Ada, Jovial..), this new stuff is all smoke, mirrors, and
voodoo. I've used Visual Basic quite a bit in Excel. It is pretty straight
forword. But not in VB.NET!!
Anyway, your 1st option works. That is the way I originally had it set up
before I decided to put it in a Module(since it seemed that it was just
cluttering up the Form). The second option, I never would have come up with.
It works also. I'm still wrestling with Chris' response about instantiation.
I have to get back to him. Again thanks for the help.
ken
"Kerry Moorman" <(E-Mail Removed)> wrote in message
news:456CEF3A-A7BC-49D3-BCF5-(E-Mail Removed)...
> Ken,
>
> One option is to place the test1 subprocedure in the form that contains
> the
> textbox. You could then refer directly to the textbox.
>
> Another option is to have the test1 subprocedure accept a textbox as an
> argument:
>
> Sub test1(ByVal myTextbox As Textbox)
>
> aa = myTextbox.Text
>
> Then, when you call the sub, send it the textbox.
>
> Kerry Moorman
>
>
> "Ken Soenen" wrote:
>
>> The code below illustrates my problem which is: I'm trying to access the
>> TEXT from TextBox1 which is on Form1. Line "aa = Form1.TextBox1.Text"
>> produces the error--Reference to a non-shared member requires an object
>> reference". Being new to VB.NET, this doesn't say much to me, nor does
>> the
>> Show Task Help for this particular msg. Just one example would make all
>> the
>> difference in the world. Can somebody point me in the right direction??
>>
>> thanks,
>> ken
>>
>>
>>
>> Module Module1
>>
>> Sub test1()
>>
>> Dim aa As String
>>
>> aa = Form1.TextBox1.Text
>>
>> End Sub
>>
>> End Module
>>
>>
>>
>>
|