Solved

Share Live Variable Changes Between Form Windows

Posted on 2010-09-02
5
264 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

815 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now