Solved

Accessing Global info from usercontrol

Posted on 1998-09-14
3
152 Views
Last Modified: 2010-04-30
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.
0
Comment
Question by:entretec2
3 Comments
 

Expert Comment

by:wiltonk
ID: 1434666
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.

e.g.
Public Sub SetArray(MyArray())
..
End Sub

Public Sub GetArray(MyArray())
..
End Sub
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1434667
Put Public in front of the definition

Public MyArray (0 to 100) as Variant
0
 

Author Comment

by:entretec2
ID: 1434668
A stupid mistake on my part
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

756 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