?
Solved

Share Live Variable Changes Between Form Windows

Posted on 2010-09-02
5
Medium Priority
?
268 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 500 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 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

752 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