• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Accessing Global info from usercontrol

I have a very simple usercontrol sitting on a form. The form code contains an array of strings ie. Dim MyArray(0 to 100). How can my usercontrol obtain that array information, it just wants to read it and check it is OK.
I tried using usercontrol.parent.Myarray but got an error message.
1 Solution
I don't think you can do this directly.

I suggest you add a Procedure in the UserControl(i.e. Sub) to pass the array in/out the UserControl.

Public Sub SetArray(MyArray())
End Sub

Public Sub GetArray(MyArray())
End Sub
Put Public in front of the definition

Public MyArray (0 to 100) as Variant
entretec2Author Commented:
A stupid mistake on my part
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now