3

So I have a main userform where I do all my calculations and I want to display them on my image forms. I tried to use:

Dim newInstance As New diagramGUI
newInstance.Show vbModeless

but then I cant access the data from the main userform. Is there any workaround for this?

enter image description here

1 Answer 1

3

You need to add a public variable in the diagramGUI userform to point the the instance of MainUserForm.

Add this line to the diagramGUI code module

 Public Controller as MainUserForm 

Then set the reference from the MainUserForm after you instantiate then new diagramGUI

 Dim newInstance As New diagramGUI
 Set newInstance.Controller = Me
 newInstance.Show vbModeless
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.