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

help with activex compiling


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
jhaigh
Asked:
jhaigh
1 Solution
 
rkot2000Commented:
try to use :

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

or

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

0
 
soferstamCommented:
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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