?
Solved

How do I send from text box to text box?

Posted on 2004-04-27
6
Medium Priority
?
263 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
Technology Partners: 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!

 
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 500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

719 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