=Environ("username")

Jun 14, 2005

I have noted a problem on 2 computers using this. There are around 30 or so computers on our network that work fine with this as a value. The majority of the users are at Access 2000 but some have Access XP. The offending machines have Access 2000

One day a persons computer crashed. DP imaged another persons machine and installed the image on the crashed machine as a solution. Since this the =Environ("username") returned #Name$ (not sure of the exact syntax on this). This same trouble surfaced on another machine recently. I unlocked the field so the users could enter their correct name but this can lead to errors and I would like to keep the username locked and read by code.

I checked the references on the offending machine and they were ok. Not sure what else there is to do to rectify this.

If anyone else has had a similar trouble and found the solution I would appreciate hearing about it.

Thanks a lot!!
-----------------------------
Edit:
I just checked the machine and corrected the syntax above. I also found that in a date search form where I have =now$() for a field, the same thing is displayed - #Name$ rather than the date.

View Replies


ADVERTISEMENT

Modules & VBA :: Use The Environ Username Somewhere In The Db?

Mar 27, 2014

Using Win 7 and Access 2007

db will be split and on a server

If it's possible: Would like to use the Environ username somewhere in the db so the user only sees their records.
Where would I place this? Or is their different code I should be using for this purpose???

View 5 Replies View Related

Modules & VBA :: Environ Username Function - Comparing Results

Apr 8, 2014

I am trying to use the Environ Username function, which i have working! But i want to compare the result with a Username Table to determine if they have access etc...

View 13 Replies View Related

Environ$("USERNAME") And Access 2003

Dec 31, 2006

How do I use the following as the default value of a textbox in Access2003?
Environ$("USERNAME")

Resolution:

Create Module and insert the following code:

Option Compare Database
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
On Error GoTo fOSUserName_Err

Dim lngLen As Long, lngX As Long
Dim strUserName As String

strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)

If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = ""
End If


fOSUserName_Exit:
Exit Function

fOSUserName_Err:
MsgBox Error$
Resume fOSUserName_Exit
End Function

Use this function as default value
=fOSUserName()

View 9 Replies View Related

=Environ("UserName") Not Working In Query

Aug 16, 2005

Hi I am using the below code for getting Windows Username, this code is working fine when i am using this in lable, however if i use this in a query, it is not working, do it need some kind of autorun?

SELECT Associates.*
FROM Associates
WHERE (((Associates.CorpID)=Environ("UserName")));

Please help.

View 2 Replies View Related

Environ

Oct 10, 2006

I was given this piece of code the other day by somebody on the forum and it works really well. My question is:

Is there a way, using a similar function that I can retrive the IP address?

Environ("ComputerName")

View 4 Replies View Related

Environ() As Login?

Mar 9, 2006

Hello,

I use Environ("Username") all the time, most frequently for logging who has done something to a record, and have once used it to log people into the database (very basic, much the same as logging who did what to records).

But I was wondering, how feasible is it as a security measure?

I often use it on the main menu of my DBs to give me a different menu (with more advanced options on) than other users.

Is it really that safe to use it as a means to allow people in, or stopping them? I know that obviously you have to stop them getting in other ways (holding shift for example), but assuming all of that is done, in theory, they should only be able to get in if they can log in as an authorised user?

Don't know why it is just struck me - just curious I suppose!

View 2 Replies View Related

Network Environ Help

Nov 10, 2006

Hi everyone

I have searched for help on this forum and all over for a while but cannot find the help i need.

I have a database stored in my user area on a schools network. Other users around the school access the database by clicking on a shortcut to it found on their start menu. The database is not split with a fe/be and usernames and passwords are not required to log on, they simply click the link.

I would like to know how I can find out which users have the database open at any given time? I have a piece of software that tells me the computer name but that is no use, I need the users name. Is there a way of pulling this from the network because each user must first log on to their computer using their name and password before they can access the database?

Any suggestions appreciated
James

View 3 Replies View Related

Environ Function In A97

Mar 10, 2005

i have a menu which recognises a user by using the environ function.

the problem i am getting is that with a small number of users the environ function isnt recognised by the system?

it gives them a #name# instead.

the crazy thing is that it also happens on simpler functions such as =Now() and =Date() which is really annoying, as these 3 things are a foundation on anything that is done within the system/!

the majority of users have no problems, which makes it even more annoying!

when i try to go into the properties of the label which has been assigned the function i get a message. (only on affected PC's)

see attached for pic

THANK YOU IN ADVANCE. HELP IS REALLY APPRECIATED!

View 12 Replies View Related

Environ Variable

Mar 19, 2006

I have written a code in VBA to get username. The code is strUserName = Environ("Username")

This doesn't seem to work in some computers. Any idea why?

View 3 Replies View Related

How To Get The Username From Workgroup?

May 18, 2006

I have the security set via the Access workgroups for both groups and users. I want to be able to use the username entered on the logon screen to filter my query results.

How can I get the logon id that was entered when my switchboard form opens?

Thanks in advance.

Dennis Cronin

View 3 Replies View Related

Username Problem

Dec 23, 2006

I have entered the following code to an onclick button. I am sure I have written it incorrectly (it's probably the line I highlighted below to do with username=Manager. By the way Manager is one of my usernames I have created.

Thanks for your help.

Rob

Private Sub Label218_Click()
If UserName = Manager Then
DoCmd.OpenReport "Tennis Teams", acNormal
Exit Sub
End If
MsgBox "You do not have permission to open this form!", vbOK, "Tennis Center Business Manager 2007"
End Sub

View 10 Replies View Related

Record OS Username

May 9, 2005

Have developed a support database in Access.


I need the dB to automatically pick up the username of the user logged on to the PC. Thus if I'm logged on to the PC as FLESTER, this username wil populate a database field.

Any ideas?

View 1 Replies View Related

How To Record The OS Username

Jul 26, 2005

How do you get Access to pick up th OS username currently logged in to the database? For example I'm logged on to the PC as FLESTER and I wnat that recorded in the dB.

View 5 Replies View Related

Windows Username

Jul 25, 2006

A couple of questions. I want my database to query the AD and make sure that the user trying to open the database had an account in the AD. I dont want them prompted for a password though. I have had a look at trying to change the example NT logon in the samples area, but just managed to get myself in a bit of a mess. Also is there anyway that you can query the users full name in AD and call that variable,or does this only work with the username?

Also, when a user created a record in a from, I would like the users username, called from the AD saved in a field in the table. I have tried this and the only way that I can call the variable is by having the "=Environ("USERNAME")" in the control source of the text box. Which means that it cant be save in a field in the table. I have also tried an after updated event on that textbox to update another textbox and have that textbox control source a field on the table. But again this doesn't work. Can someone tell me if what I am trying to do is possible. Thanks

View 1 Replies View Related

Username Issues

Oct 16, 2006

Hi all

I am currently trying to create a form that will have the ability to show the last person that edited that form and the time and date that it was last modified. When I try though I just keep getting the field to update to me just by viewing it. Can anyone give me a fairly detailed way of doing this?


Kind Regards


David:)

View 2 Replies View Related

Password/Username Help

Sep 26, 2004

I created a password for my database and now I cannot access it. The dialog box says that either the username or password may be incorrect. I do not know what the requested username is. I do not recall creating a username during the process of creating the password. I do not know what username ACCESS is asking for. I think I know what the password is. I think the problem is the username. However, if I somehow do not know the password, what can I do?

After you finish laughing at me, please help. Thanks for any assistance you can provide.

View 1 Replies View Related

Username And Password

Aug 10, 2006

I want to secure my Access database with a username and password. I want to be able to pull the nt login of the user and have them access only the things i need them to access. How can I do this?

View 4 Replies View Related

Username & Password

Sep 25, 2007

Hi,

i have an access db which i want to protect with various usernames & passwords how do i go about this?

View 3 Replies View Related

Clear Login UserName

Jul 18, 2006

Hi all,

I've had a quick search but couldn't find the answer to this.

Is there a way that when a user launches the application via my workgroup file, the default login name is always null?

Currently it retains the last users' login name.

Thanks
Kempes

View 6 Replies View Related

Username & Password Woes!

Jan 10, 2007

Hello!
I have a problem regarding using usernames and passwords to restrict access to certain tables/forms/reports etc....
I have read around the forum and various other websites but cant seem to get much relating to exactly what i am wanting to do.

I think i understand the way the access workgroup security works. But does this not just restrict users being able to view the database as read-only or with other certain rights like that? So, firstly would i be able to use this to restrict the database the way i want?

Or is there a way to create a table with names and passwords and create a form at the beginning where the user inputs their details and then according to the details gives/restricts access to parts of the database? Ideally i'd like the startup form to direct them to a different menu according to the user which gives them only the options they are allowed?

Seems a bit of a mouthfull and i sound like a complete newb but i been trying to figure this out all day!!
Thanks

View 2 Replies View Related

Unique Username Routine

Jun 8, 2006

Hello,
I was wondering if you have one or have seen a routine to generate unique
username from first, middle and last names. Here is my requirement -
by default first initial and last name of a user is their username.
But if the expected or default username is already taken then if the
user have middle initial, then the username for this user would be
first initial, middle initial and lastname. If the user does not have
middle name then the username for the user would be first two letters
of first name and lastname and if that's already taken then first
three letters of first name and last name and so on.

Any help or pointer is greatly appriciated.

View 2 Replies View Related

Get Username Of Current User

Oct 23, 2005

Hi
I have designed a MS Access tool accessed by multiple user. The first screen asks for badge number which is unique for each user. I wanted to do away with that screen. Instead wanted to get the username of the currently logged in user, may be from registry or somewhere. We have Windows XP here. Is there any VBA script for that....Need help!!

View 5 Replies View Related

Access Doesn't Ask For Username And Password

Jun 23, 2006

I created security using the security wizards, separating admins vs. data entry users. I gave everyone a username and a password but when I reenter the database it doesn't ask me for my username or password. Does anyone know why or how can I fix it?

View 2 Replies View Related

Display UserID And Username On The Form

Aug 16, 2005

Hi I want to do following in my application

1. Display userid and user name on the form, how can i do it.
2. When i am adding record, user should not be able to go back to previous record.
3. A form should open automatically when i open my application.

View 1 Replies View Related

Create Username And Password Promt?

Sep 17, 2004

Hello,

I was wondering if it were possible to make a msg box pop up when opening a database asking for a user name and password. And that will be the only way to enter the database.

Thanks

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved