Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

help with activex compiling

Posted on 2002-04-08
2
Medium Priority
?
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
rkot2000 earned 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Suggested Courses

618 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