Solved

help with activex compiling

Posted on 2002-04-08
2
174 Views
Last Modified: 2010-05-02

i am trying to compile an activex control but i get this error...

"compile error

private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined types."

the problem seems to be with this procedure.

Public Sub ControlsVisible(Txtctrl, LblCtrl As Control)

lblDisc.Visible = False
lblRoller.Visible = False
lblBearing.Visible = False
lblBlock.Visible = False
lblGear.Visible = False
lblDriveShaft.Visible = False
lblChain.Visible = False

TxtDisc.Visible = False
TxtRoller.Visible = False
TxtBearing.Visible = False
TxtBlock.Visible = False
TxtGear.Visible = False
TxtDriveShaft.Visible = False
TxtChain.Visible = False

Txtctrl.Visible = True
Txtctrl.Top = 2505
Txtctrl.Left = 1575

LblCtrl.Visible = True
LblCtrl.Top = 2025
LblCtrl.Left = 75

End Sub


What am i doing wrong here? I put the same code in a standard .exe project and it works ok..

0
Comment
Question by:jhaigh
2 Comments
 
LVL 5

Accepted Solution

by:
rkot2000 earned 100 total points
ID: 6925528
try to use :

Public Sub ControlsVisible(Txtctrl As object, LblCtrl As object)

or

Public Sub ControlsVisible(Txtctrl As variant, LblCtrl As variant)

0
 
LVL 1

Expert Comment

by:soferstam
ID: 6935464
The sulotion by rkot2000 will work
The error is that your Txtctrl, LblCtrl  are already placed on the same control...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now