R
rocco
Hello,
I have a class module and at module level I have declared a custum data
type. This is the code:
Option Compare Database
Option Explicit
Public Type valutatore
codrater As Integer
lastname As String * 50
ratername As String * 50
End Type
This code will not work because it says i cannot define a Public
user-defined type within an object module. I have thus added the 'Private'
and it works.
My question is why it will not work since in the help it is written: <<In
standard modules and class modules, user-defined types are public by
default.>>
So I understood that I can use 'Public' (but compiling gives me the error
reported).
All this mess is because I want to have the variable declared of my
user-defined type to be accessible also from other modules in the project.
But the help says that...<<you can declare a variable of that type anywhere
within the scope of the declaration...>>. So I guess that I can only go
'Private'.
So, since I'm almost sure it is me...what I missed to understand the right
way?
Thanks!
Rocco
I have a class module and at module level I have declared a custum data
type. This is the code:
Option Compare Database
Option Explicit
Public Type valutatore
codrater As Integer
lastname As String * 50
ratername As String * 50
End Type
This code will not work because it says i cannot define a Public
user-defined type within an object module. I have thus added the 'Private'
and it works.
My question is why it will not work since in the help it is written: <<In
standard modules and class modules, user-defined types are public by
default.>>
So I understood that I can use 'Public' (but compiling gives me the error
reported).
All this mess is because I want to have the variable declared of my
user-defined type to be accessible also from other modules in the project.
But the help says that...<<you can declare a variable of that type anywhere
within the scope of the declaration...>>. So I guess that I can only go
'Private'.
So, since I'm almost sure it is me...what I missed to understand the right
way?
Thanks!
Rocco