Enumerations

  • Thread starter Thread starter Christian
  • Start date Start date
C

Christian

Hello,

I use a lot of classes in an Microsoft Access 2000
Database. Some of the classes contain enumerations. In MS
Access 2000 all works fine, but when I open the database
in MS Access XP, the enumerations don't seem to work. For
example:

Public Class clsExample

Public Enum ForExampleEnum
Example1
Example2
End Enum

Public Sub ExampleSub (Value As ForExampleEnum)

End Sub

End Class

When I use this class in a module, the enum-values are not
recognized:

Public Sub CallingTheClass

Dim objExample As New clsExample

objExample.ExampleSub ( here I would expect a list
with two choices, 'Example1' and 'Example2')

End Sub

As I said, running the database in Access 2000 works just
fine, no problem at all. But in Access XP it doesn't work.
Does

anyone know what can be the problem?

Greetings,
Christian.
 
Since no-one answered your same question yesterday ...

- I know that enums were not supported in Access 97 VBA. Are you sure that
they are formally supported in the hihger versions? (I don't have Access 2k+
here to check.) If not, then perhaps they work "by chance" in A2k, but not
in AXP.

- Are you really using "Value" as the name of a formal parameter? Value is a
reserved word. Pick something different & see if that helps.

HTH,
TC
 
Back
Top