Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I send from text box to text box?

Posted on 2004-04-27
6
Medium Priority
?
264 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
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

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!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

886 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