Constants "Collection"

  • Thread starter Thread starter Ed Kopta
  • Start date Start date
E

Ed Kopta

I'm wondering if there is a way to create a "collection" of constants, along
the lines
of DataTypeEnum. I'd like to be able to write a function like:

Function Fnct(lng As MyEnum)
....

and then have all the constants I've put into MyEnum appear in the handy
drop down menu when I call the function.

Access 2002, DAO

Thanks for the help if there is a way to do this (or even if there isn't).

Ed Kopta
 
Ed said:
I'm wondering if there is a way to create a "collection" of constants, along
the lines
of DataTypeEnum. I'd like to be able to write a function like:

Function Fnct(lng As MyEnum)
...

and then have all the constants I've put into MyEnum appear in the handy
drop down menu when I call the function.

Create a class module, save it as MyEnum, and "store" your constants
like this:

Property Get yourName() As String
yourName = "dunno"
End Property

Property Get myName() As String
myName = "dono"
End Property

Now, if you type 'lng.' in the body of Fnct, you will get that list.
 
Back
Top