gakiss2
Registered User.
- Local time
- Yesterday, 20:39
- Joined
- Nov 21, 2018
- Messages
- 168
I have a CurrentUser table. Only function is to hold the username of the person currently 'logged on' This is set by a 'log in' form from which the user selects their name. This is very basic login process. Later I want to add a password control and use the username to control access to records but for now I am working on something much simpler. I have a tabular form frmDocViewAll which lists records the user might want to work with. I have a cbo box where the user can select their own name and that is tied to the select query built into the form. All that works.
With few exceptions, (maybe supervisor view?) the user will only want to see their own records. So I thought it would be more efficient to put that aforementioned CurrentUser value into the cbo box so when the user opens the form it is already set to view their records. Or maybe just skip the cbo box altogether and just make the form show only the users records. Either works for me right now. I can always add a supervisor view later.
I tried using the default value on the cbo control [tblCurrentUser]![CurrentUser] but I get #name?. I tried to put the above in quotes. It got rid of the error but just put [tblCurrentUser]![CurrentUser] in my cbo box which was useless.
I am open to other solutions but I see the need to get that properly into the Default for the cbo or for the form itself.
Also, closely related. My db is on a server which multiple people can open. If Shawn has it open, then Matt opens it, I think it will work for Matt because Matt was the last one to open it. If Shawn then closes it then reopens it after Matt had logged in, will it think Matt is the 'CurrentUser'?
Thanks is advance.
The attached table doesn't have any data. let me know if that is an issue.
With few exceptions, (maybe supervisor view?) the user will only want to see their own records. So I thought it would be more efficient to put that aforementioned CurrentUser value into the cbo box so when the user opens the form it is already set to view their records. Or maybe just skip the cbo box altogether and just make the form show only the users records. Either works for me right now. I can always add a supervisor view later.
I tried using the default value on the cbo control [tblCurrentUser]![CurrentUser] but I get #name?. I tried to put the above in quotes. It got rid of the error but just put [tblCurrentUser]![CurrentUser] in my cbo box which was useless.
I am open to other solutions but I see the need to get that properly into the Default for the cbo or for the form itself.
Also, closely related. My db is on a server which multiple people can open. If Shawn has it open, then Matt opens it, I think it will work for Matt because Matt was the last one to open it. If Shawn then closes it then reopens it after Matt had logged in, will it think Matt is the 'CurrentUser'?
Thanks is advance.
The attached table doesn't have any data. let me know if that is an issue.