Solved

help with activex compiling

Posted on 2002-04-08
2
178 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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Acccess - Update Field in Table when report is printed 6 51
How to debug this code 7 65
Access query that references subform 5 48
Recommendation vb6 to vb.net or others 14 210
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

696 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