PC Review


Reply
Thread Tools Rate Thread

private types

 
 
Jesper F
Guest
Posts: n/a
 
      17th Mar 2006
I'm getting a "Compile error - user-defined type not defined" with this :

In declarations:
Private Type SelDim
iWidth As Integer
iHeight As Integer
End Type

In the module:
Function SelectionDimension() As SelDim
SelectionDimension.iWidth = 3
SelectionDimension.iHeight = 4
End Function

What's wrong? Thanks.


Jesper


 
Reply With Quote
 
 
 
 
Sandra Daigle
Guest
Posts: n/a
 
      17th Mar 2006
Where are you getting the error? The function would have to be a private
function in order to return a private type. Could the problem be that you
are calling the function from outside of this module?

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Jesper F wrote:
> I'm getting a "Compile error - user-defined type not defined" with
> this :
> In declarations:
> Private Type SelDim
> iWidth As Integer
> iHeight As Integer
> End Type
>
> In the module:
> Function SelectionDimension() As SelDim
> SelectionDimension.iWidth = 3
> SelectionDimension.iHeight = 4
> End Function
>
> What's wrong? Thanks.
>
>
> Jesper



 
Reply With Quote
 
Jesper F
Guest
Posts: n/a
 
      17th Mar 2006
> Where are you getting the error? The function would have to be a private
> function in order to return a private type. Could the problem be that you
> are calling the function from outside of this module?


You're right private/public and calling it from outside the module.
Thanks!

Jesper


 
Reply With Quote
 
RD
Guest
Posts: n/a
 
      17th Mar 2006
On Fri, 17 Mar 2006 15:44:58 +0100, "Jesper F" <(E-Mail Removed)> wrote:

>I'm getting a "Compile error - user-defined type not defined" with this :
>
>In declarations:
>Private Type SelDim
> iWidth As Integer
> iHeight As Integer
>End Type
>
>In the module:
>Function SelectionDimension() As SelDim
> SelectionDimension.iWidth = 3
> SelectionDimension.iHeight = 4
>End Function
>
>What's wrong? Thanks.
>
>
>Jesper
>


I think maybe it's the way you're using it. I just noodled around with this for
a few seconds and I didn't get an error.

Function fSelectionDimension() As String
Dim SelectionDimension As SelDim
SelectionDimension.iWidth = 3
SelectionDimension.iHeight = 4
fSelectionDimension = SelectionDimension.iWidth & ", " &
SelectionDimension.iHeight
Debug.Print fSelectionDimension
End Function

Result was 3, 4.

HTH,
RD

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Meetings- Private notes and private color coding SP Microsoft Outlook Discussion 1 18th Feb 2010 10:26 PM
Improve method of calling a private function in a private module XP Microsoft Excel Programming 1 30th Apr 2008 07:41 PM
Returning private members of base types Andrus Microsoft C# .NET 0 5th Apr 2008 06:44 PM
Testing Private Types =?Utf-8?B?RGljaw==?= Microsoft Dot NET 7 3rd Jul 2006 08:27 AM
private types - overhead if retrieved seperately? Jesper F Microsoft Access VBA Modules 9 9th Jan 2006 08:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:21 AM.