Are you using the same event sheet for both layouts?
If not, go to the second event sheet → right-click → Include Event Sheet. This allows the second one to read/write to the variables of the first one.
If you don't like this approach, you can also create an event sheet just to store these kinds of variables and include it wherever you need.