Solved

How does CurrentUser work?

Posted on 2016-10-19
10
38 Views
Last Modified: 2016-10-20
I'm trying to create a Login form for a Access 2013 program.  I'm finding CurrentUser referenced in the program's vba code (ventage Access 2003).  If I create a Login form/function, do I need to save it as CurrentUser?  If so, how do I do that?

Judith
0
Comment
Question by:JudithARyan
  • 6
  • 4
10 Comments
 
LVL 6

Expert Comment

by:efrimpol
ID: 41850919
0
 

Author Comment

by:JudithARyan
ID: 41852374
The link doesn't cover how the system/access sets or obtains CurrentUser.  I'm trying to write my own security procedure for Access 2013.  Do I need to set CurrentUser after a user logs into my security login form?  If I don't set it, will it continue to use Admin?

Judith
0
 
LVL 6

Expert Comment

by:efrimpol
ID: 41852421
Also reference the following link:

https://bytes.com/topic/access/answers/842129-get-windows-logon-username-into-form-field

There is a module that you will need to create and save (the above link references that and even supplies the code).

Then further on down, there are instructions on how to add it to the form.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 6

Expert Comment

by:efrimpol
ID: 41852423
Sorry.

This is the link to the code:

http://access.mvps.org/access/api/api0008.htm

That is what you have to copy into the module.
0
 

Author Comment

by:JudithARyan
ID: 41852552
Somehow you've gotten off on the wrong track about what I need.  

The login I'm concerned about is the user logging into my Access application, not a Windows login.  The way our office is setup, we have multiple volunteers using a workstation at different time during a week.  

So, all my questions are directed toward an Access app login.

Sorry for the misunderstanding.

Judith
0
 
LVL 6

Accepted Solution

by:
efrimpol earned 500 total points
ID: 41852612
Unless you have Access Security enabled, anyone who opens the database will be identified as "Admin".

But if you don't and you wish to create a login form, then this may be more geared to what you are looking for:

http://www.iaccessworld.com/create-login-form-ms-access/

I have attached an example db that I downloaded from another site. You can open it in design mode to get a better idea of how it is set up.
loginexample.zip
0
 

Author Comment

by:JudithARyan
ID: 41852675
Thanks! you're my best solution.  

So what is Access Security and how is it enabled?

Judith
0
 
LVL 6

Expert Comment

by:efrimpol
ID: 41852752
In versions prior to Access 2007 (2003 and below), you would use a MDW file and you can set up users and permissions and stuff.

Then they (Microsoft) took it away from 2007 and forward.

The login form is a workaround.

There are also other methods you can use, but this is really the easiest as the others involve writing codes and using Modules and Event Triggers.
0
 

Author Closing Comment

by:JudithARyan
ID: 41852984
Thank you for all your help.  Judith
0
 
LVL 6

Expert Comment

by:efrimpol
ID: 41852985
EE aims to please. Remember to close the post!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB 6.0 printer how to align 6 67
How to measure sizes and angles in scanned images ? 3 76
Macro Excel - Multiple If conditions 2 81
Automatic Email Reminder 4 58
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question