Let's imagine I have the following VBA code in a Microsoft Access database.
Option Compare Database
Public Enum testdata
foo = 0
bar = 1
baz = 2
End Enum
Just for context, I'm declaring this in a module like so:
Now, what I want to happen is to have a category field in a table auto-fill with list items based on this enum, like so:
I had to manually type each list item out in order to show what I want, but surely there must be a way to "link" an enumerated list of constants in VBA code to a field in the table, so that when I add new entries to the enum, the list of categories updates accordingly. I tried looking it up on the internet but I couldn't figure out the best way to explain what I'm trying to do without using pictures.