Question : Access - Feed a constant value into sub-forms

Hi Experts,

I have a form with 10 subforms.  My database does not have user IDs, so when a user makes a comment into one of the 10 subforms there is a user field that I have defaulted to the user name.  In other words, in each junction table there is a field called User.  When I load the front end on a user's PC, I default the the field in each of the 10 subforms to the user's name so that each sub-record is automatically 'stamped' by the user name.  Other users then know who made what comment.  This is obviously a pain because I have to manually change the name in 10 subforms each time I put the database on a user's PC.  

I know that this is incorrect and am pretty confused about modules and declaring a constant...i.e. could I declare a constant in a module and only have to change the value once each time I load a front-end on a user PC?  Is there a good tutorial out there that might help me understand how this works, because I get confused by the things I have found on the net.

Any help would be appreciated.

Thanks!

Answer : Access - Feed a constant value into sub-forms

You should be able to set the default value in the table(s) to =envron("username"). It will pick the logged on user of the PC from what you see when you type SET at a dos prompt. If this is a high(er) security database -- there are functions that force it to read the username from the system/domain. If you need that, let me know.
Random Solutions  
 
programming4us programming4us