Passing Variables to Multiple Forms
Posted on 2004-11-15
I have searched for and read several responses to questions and I'm still coming up a little hazy on this. Here's the deal. I have a project in which I will have employees updating people's records. Imagine a list of names that can be double-clicked. When a name on a list is double-clicked, it displays another form that shows everyone's name, address, etc -- all data we have on that person. Now from there, I have a third form that can be activated by someone checking on a checkbox control. When this checkbox is clicked, I want to display a third form that will have some of the variables from the FIRST form.
I can't make these values global or public because someone may have several records open at one time, and may hop from one record to the next and may not update the records in the order they were accessed. Therefore, I need to create distinct "copies" of this variable available on the third form, and they will always have to come from their own "parent".
This is an example of how the variables would be used:
Double-click Name #1, create DetailForm #1
Go back to Mainform, double-click Name #2, Create DetailForm #2
Go back to DetailForm #1, click the checkbox, display some of the variables from DetailForm #1
Go back to DetailForm #2, click the checkbox, display some of the varables from DetailForm #2
Somehow I need to make sure all the "children" variables are kept with their proper "parent" variables, if that's the terminology I need to use. I'm not asking you to write the code for me (although examples are always appreciated)! It would be much better if you could explain the concept of what I need to do so I can learn it myself ... I'd appreciate it very much.