dynamic enum  or auto list reords

Posted on 2005-02-26
Medium Priority
Last Modified: 2013-12-25
I have a table with only 15 to 20 records and can go up to 50 records.
the flds are
Id , value

eg., 1 Techlog
       2 Stationlog
Is there any method where in i can use the records as enums, so that it would be coming in vb autolist so tht if i refer tht variable it would be easy to refer and code
like dynamically create enum like thing
public enum module
     iTechLog = 1
     iStationLog = 2
end enum

M.Naveen Swamy
Question by:Naveen Swamy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 75

Accepted Solution

Anthony Perkins earned 140 total points
ID: 13417023
No.  Enums cannot be defined dynamically.

Expert Comment

ID: 13507504
One approach you might try (if you haven't already) is to load those values into a combo dropdown list, and use the ID value as the ItemData.  That way when an item is selected, you can get the corresponding ItemData that you know is the database key.

If what you want is internal (ie not for the user), then just dynamically loading up an array with the values should get you similar results as the enum.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question