Solved

How do I send from text box to text box?

Posted on 2004-04-27
6
261 Views
Last Modified: 2012-05-04
I have a text box named txtFname.text and txtLname.txt in two different forms.  I want to send the first txtFname.text which is in my FindCustomer.vb form to the txtFname.text on another form which is called SelectService.vb, how can I do this?  I need to do the same for txtLname.text field.
0
Comment
Question by:djdx2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 1

Author Comment

by:djdx2
ID: 10931562
By the way I want this to happen when I click on a button named... btnGoToService
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10931639
Declare txtFname on SelectService form as public, then you will be able to call SelectService.txtFName.Text = txtFname.Text from FindCustomer form


OR

in SelectService form create a property:

Public Property FName As String
        Set(ByVal Value As String)
            txtFName.Text = Value
        End Set
End Property

and assign text using that property
0
 
LVL 1

Author Comment

by:djdx2
ID: 10931855
I actually want to send it from a text box named txtFName1 to a label now named lblFName when the button is clicked....how about this?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 2

Expert Comment

by:Jeffr0
ID: 10931886
Also, you will need a reference to the SelectService form somewhere.

In a module store a global variable like this:

Module Stuff
     Public _SelectService as Form
End Module

When you instantiate the form, set the reference variable to point to the form like this:

Dim f as New SelectService()
f.Show
_SelectService = f

Now you can talk to all of the public items on the form just like chaniewskim was saying:

_SelectService.FName  = "Test"

or

_SelectService.txtFName.Text
0
 
LVL 2

Expert Comment

by:Jeffr0
ID: 10931899
The text field of the label can be altered the same way as the textbox.
0
 
LVL 5

Accepted Solution

by:
chaniewskim earned 125 total points
ID: 10931903
OK, so don't worry with creating properties - you'll have time to learn this.

Click lblFName and set Modifier to Protected (using Properties window)

Then doubleclick btnGoToService and place a code

SelectService.lblFName.Text = txtFName1.Text

I don't know the name of you SelectService form variable - so update that code accordingly.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question