NotSoRandomOne
Registered User.
- Local time
- , 20:57
- Joined
- Sep 15, 2009
- Messages
- 51
I'm trying to record visits to patients, and there will be five or so visit types. Right now I have a table of these visit types, and it works, but it is difficult to use. For instance, in code, to take action based upon a visit type requires the following, because I refuse to use the ID as a hard-coded value for debugging purposes:
It would be much simpler to use an enumeration, such as is possible in C++. Can that be done? Is it a better approach than the table-based one? How do I do it? In the common module, as a global (which are frowned upon)? Or should I break down and use the ID of the corresponding visit type, and ignore the fact that the person doing debugging no longer has meaningful information at their disposal?
Thank you for any feedback.
David
Code:
If (tvlt_rs![VisitType] = DLookup("ID", "VisitTypesTable", "VisitType='Regular Visit'")) Then numRegVisitsPerformed = numRegVisitsPerformed + 1
Thank you for any feedback.
David