Select User at startup

AgDawg

Registered User.
Local time
Today, 12:05
Joined
Oct 12, 2012
Messages
24
Ok I have my database the way I like it now I want to add some time saving features. Many places in my database you must select a sales rep from a combo box to view the records. It would be handy to have a combo box that pops up when you open the database and then you select the sales rep from there so all the forms will use that value when displaying the data. I have done some searching but not really finding the results. Is there a name for what I am looking for?
 
There are several ways in which to accomplish what you are talking about.

Perhaps the most simple would be to define an application global variable in a VBA module, top of module outside of any functions / subs. Once the program knows the value, it should then assign to the VBA variable the desired value. Other places in your program, you may look up the current value of the variable. For example when creating a new record, you could have the field the special value is suppose to be in Locked so users may not change it, and in the Open method of that form set the field's value to the current value of the VBA variable.

This is the most simple and brute force way to accomplish what you are talking about.
 
I do that with several items and save their values, tied with the user's loginID, so that they only need to select an item once and then from that point on out it uses that as the default unless they decide to change it in their preferences.

Loading up the preferences at run time to either some properties or global variables is easy. The properties are less volatile than the global variables but as long as you have good error handling the loss of globals is not much of a concern.
 

Users who are viewing this thread

Back
Top Bottom