I have developed a Leave / Overtime tracking database and I would like to use best practices to ensure it can be used in multiple offices within our organization. To that I would like to not hard code phrases in the VBA but store them so they can be easily edited and maintained. I am not sure if it is better to create a table to save these or a config text file that would be referenced. For example, part of the code will generate an email, and in different offices the subject may be different - if it is in the VBA then it would need to be recompiled where as in the table you need to edit the field only.
I hope I have explained myself clearly with this, I tried searching before and couldn't find anything that seemed to address this issue.
Thank you
gemma-the-husky
05-27-2011, 03:03 AM
a table is probably better, as you can do a quicker indexed read. With a table you probably have to read the whole set into memory.
However, there are a couple of issues. Everyone has to be aware that there is a common set of messages. One user could change a message, without realising it affects others. If you have the messages in a local table, then this isn't the case - but any new version releases will overwrite that users changes. If you want each user to have their own messages then in this case, you are probably better storing individual messages in a text file for each user.
An alternative is to store all the messages in a master spreadsheet, and update the message table in the system. It's just easier to control a spreadsheet, I think.
The message table is similar to the slick way access generates its internal errors. That is even more complex, as they have placeholders in the standard messages, to infill at runtime.
if you have multiple languages, you probably have ot do this anyway - might be worth trying to find a demo of that - as that would give you some pointers.
Thanks for the tip - I don't think the issue of changing messages should occur, only certain users designated as Admin will be able to see those fields. I appreciate your quick reply - will give me something to play with next week ;)