Solved

Share Live Variable Changes Between Form Windows

Posted on 2010-09-02
5
266 Views
Last Modified: 2012-05-10
I'm wondering how to make sure my forms have "live" links to variables in my other forms. I have a datagridview on one form where I make some selections, then I hit a button, and another form pops up displaying that information. If I select the right things on the first form and open the second, all is well. If I forget to select something, or try to change something selected in my datagridview after the second form is opened, the second form does not have the current information. I'm pretty sure I've just got a situation where the second form only "sees" the information from the first form that was present at the time the second form was opened.

How do I best remedy this so that the most up to date information is available to the second form?
0
Comment
Question by:diablo089
[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
5 Comments
 
LVL 12

Expert Comment

by:GMGenius
ID: 33591019
How is the second form accessing the information in the datagrid? on the first form
0
 

Author Comment

by:diablo089
ID: 33591037
In the form of:

(Name of Form).DataGridView1.Rows(index).Cells("Cell Name").Value
0
 
LVL 12

Accepted Solution

by:
GMGenius earned 125 total points
ID: 33591079
Is the reference to the first form in the second forms load event?
if it is, you could try making a subroutine for the second form update and call it in the form load event and the form activate event,
That way if you click back to form 1 then click back to form 2 , this will fire the form 2 activate event again and call the refresh data.
0
 
LVL 18

Assisted Solution

by:John (Yiannis) Toutountzoglou
John (Yiannis) Toutountzoglou earned 125 total points
ID: 33591463
before you open the second form set a value to a "Public Variable"....You can use many Public variables....
so before you open the form let's say that SelValue is already an integer Public Var ..:
SelValue=Me.DataGridView1.Rows(index).Cells("Cell Name").Value (or FormatteValue)
Then in form 2 you can use SelValue anywhere...
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33591590
Other option Reffering also to my first comment is to open the second form as dialog..so the user does not have the chance to change something in the first form ..
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

Suggested Solutions

Title # Comments Views Activity
get combo value in class 5 24
Very Large data in MYSQL 7 94
How can I add google maps in vb.net. 2 19
Set arraylist as datatable 2 8
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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