Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Form data transfer

Posted on 2007-07-30
6
Medium Priority
?
152 Views
Last Modified: 2013-12-26
Hi Experts

I have three forms form1 is loaded as the main form, form2 is loaded when a button is clicked on form1, and in turn the user can select another option on form2 and form3 loads.

If form2 is loaded independently and form3 is opened from form2 and an item is selected  on a listview on form3,  the listview items text is sent to a textbox on form2.

Why will this not work when form2 is opened by the button on form1? I need form1 to stay open as the background while these events take place.

Sample Code:
form2.ColName.Text = StrConv(Me.MyListview.SelectedItems(0).SubItems(0).Text, VbStrConv.ProperCase)

Regards,
Joe
0
Comment
Question by:JoeBo747
  • 3
  • 3
6 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 19592125
How do you open your form2 ?
Can you show us the calling code-pieces...
0
 
LVL 1

Author Comment

by:JoeBo747
ID: 19592147
Hi Dhaest:

Form2 is opened using:

Dim F2 As New JobRequest()
        F2.Show()

Regards,
Joe
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 19592159
Dim F2 As New JobRequest()
F2.ShowDialog()

And then you can get the data back from your form2 (if you want)

How does your form3 opens in form2 ?
0
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!

 
LVL 1

Author Comment

by:JoeBo747
ID: 19592290
Hi Dhaest:

Your last comment put me right, If I open the form using:

JobRequest.Show()

I am able to pass the values, If I where to open the form using

Dim F2 As New JobRequest()
F2.ShowDialog()

How would I pass the the values?

Regards,
Joe
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 19592316
To easily transfer the data between forms, create a public variable that you fill and read

Dim F2 As New JobRequest()
F2.ShowDialog()
myVariable = F2.thisVariable

and on form jobRequest
public thisVariable as string
(in one some kind of procedure you'll have thisVariable = "TEST")
0
 
LVL 1

Author Comment

by:JoeBo747
ID: 19592357
Hi Dhaest:,

Thanks.

Regards,
Joe
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month21 days, 6 hours left to enroll

810 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