pass non related table value to a control (1 Viewer)

gakiss2

Registered User.
Local time
Today, 14:58
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.
 

Attachments

  • Quik Doc Track improve 1.1.accdb.zip
    1.2 MB · Views: 92

theDBguy

I’m here to help
Staff member
Local time
Today, 14:58
Joined
Oct 29, 2018
Messages
21,473
Hi,

For your first question, one option for you is to save the login info in a memory variable, so you can use it everywhere. For the second question about multiple users, sounds like you don’t have your database properly split. Each user should have their own copy of the front end application connected to the same back end data source.
 

gakiss2

Registered User.
Local time
Today, 14:58
Joined
Nov 21, 2018
Messages
168
Went with Pbaldy suggestion. I'm new to login process in general but I think I need to use a table to store passwords, etc. Haven't tried having each user have a copy of 'front' on their own computer but I will after I get a few more wrinkles straightened on this current improvement project.

So is there a right way to present multiple questions / threads all relating to an overall project? So far I am just opening new topics for each.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:58
Joined
Oct 29, 2018
Messages
21,473
Hi,

Glad to hear you got it sorted out. If the question is about a different problem, even for the same project, I would suggest to start a new ew topic.

Good luck with your project.
 

Users who are viewing this thread

Top Bottom