Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing user defined types between modules

Posted on 1998-07-24
2
Medium Priority
?
294 Views
Last Modified: 2010-05-03
Is it possible to pass user defined types between modules? I am receiving the following error message if I pass an instance of my type to a public sub: "User-defined types and fixed-length strings not allowed as the type of a Public member of an object module; Private object modules not allowed as the type of a public member of a public object modules", passing to a private sub in the same module is OK.

0
Comment
Question by:mark_s
[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 1

Accepted Solution

by:
gissing earned 50 total points
ID: 1466584
If you want to pass a UDT between two modules, the UDT has to be declared as public, so that both modules can see it.
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1466585
Classes can not have methods that have parameters using UDTs... if they are exposed (public).   To combat this, you can do one of 2 things:

1)  Build another class, which just has variables for your type, and pass that

2)  Build a collection to pass back and forth, using the KEY as the name of each variable


Mark's answer is wrong in this case..  He's correct for bas modules.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

715 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