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 Replies
ADVERTISEMENT
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
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
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
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 9 Replies
View Related
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
Sep 19, 2013
I'm currently using for my Login Form.My question is there a code I can to make sure each user see only a certain Navigation Bar as well. For example: This user below I only want to see the "Reports" Navigation Bar.
UserName.SetFocus
If UserName = "username" And Password = "password" Then
DoCmd.Close
DoCmd.Close , "F_Login", acSaveNo
DoCmd.OpenForm "Switchboard"
View 3 Replies
View Related
Oct 19, 2014
I want to create a user name and password in to access my data base
View 3 Replies
View Related
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
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
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
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
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
Jan 29, 2007
Hello,
I have installed Microsoft Access 2003 and Microsoft Access 2003 Developer Extensions. I can create Access application by using the Package Wizard.
But after I upgrade from Microsoft Access 2003 to Microsoft Access 2007.
I can't use the Package Wizard.
How can I do to solve this?
Thanks.
View 1 Replies
View Related
Apr 15, 2007
I have two database applications and they are:
- the (A) application is for administration use.
- the (B) application is for normal users use.
the idea is that: I made the (A) application for administrators who have full control over the database objects (tables, forms, queries, and so on ...).
the (B) application I have created for normal users who will have only to use forms to insert some data and display data only.
but the two applications has a respective table called "vacation request" table. where I linked them, so the both administrators and users can share the data.
The real question is that: How can I prevent the users from seeing the database objects in their application. I used the database options which have helped me in hidding the database objectives when the users open the application, but unfortunately they managed to access to the database objects by pressing the special keys.
I would like to have an access to the (B) application when I want to make some modifications to the forms and then lock it from users where they only have to use the forms for requesting vacations and view the vacations.
View 1 Replies
View Related
Oct 24, 2013
I've been using the following code successfully in Access 2003 & now I need to migrate to Access 2010. The purpose of the code is to use the items that the user selects in the list box to build the criteria of a query. Access 2010 keeps giving me a syntax error when I try to run the query & I don't know why:
My code is:
On Error GoTo Err_Command151_Click
' Declare variables
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim varItem As Variant
Dim strCriteria As String
Dim strSQL As String
[Code] .....
The syntax error I get in Access 2010 is:
Syntax Error in query expression 'SELECT * FROM
qryContractListSummarybyDateContract3TYPEBREAK WHERE
qryContractListSummarybyDateContract3TYPEBREAK.Rep ortableName IN('Adbri
Masonry NSW');'
View 12 Replies
View Related
Jun 19, 2007
Attached is a screenshot of the relationships in a database I built a couple of years ago. It's worked absolutely fine in Access 2003 and currently has over 18,000 customers with associated information in it.
However, when I open the database in Access 2007 the performance is awful. All the forms are very slow to respond when tabbing between form elements. I've experimented by reducing the number of form elements calling on related data on a given page and whilst this improves performance it reduces usability - something I don't want to compromise on especially since Access 2007 should be able to cope with this.
My next question is therefore whether I've got the most efficient underlying table design and I can't see any other way of doing it than my current method so I'd be grateful for any feedback or advice anyone has.
View 2 Replies
View Related
Apr 19, 2005
I am working on a massave aplication that has been running in Access 2000, but recently several of the file sharing users have installed Access 2003 because of the limited availability of Access 2000. All the users are using the same file off the server.
The problem we are having is that when we reference a subform in the "[Forms]![FormName]![SubformName]![FeildName]" Access 2003 does not recognize it and returns an error. I have found that if I will modify it to "[Forms]![FormName]![SubformName].[Form]![FeildName]" it is recognized in both 2000 and 2003.
To try and change every instance of a subform reference will take forever and I am garuteed to overlook something. We reference subforms all over our program, missing any one of them would be a disaster. Before I went to the tedious task of looking through everything I just wanted to throw the situation out there and see if any of you had any great ideas on how to get it fixed efficiently. I would apreciate any ideas.
View 5 Replies
View Related
Jun 6, 2005
I upgraded a 2000 db to 2003 recently. When I ran the function below it gave me an error on the line in green. Any thoughts? Thanks.
Const FIRSTROW = 13
Dim wsp As Workspace, dbv As DAO.Database, tblResolve As DAO.Recordset
Dim tblVchs As DAO.Recordset, tblImpTmp As DAO.Recordset
Dim ObjXLApp As New Excel.Application
Dim FileToOpen As String, WhereCriteria As String, ImportTemp As String, tmpVch As String
Dim TotalDupes As Integer, TotalGood As Integer, TotalRejects As Integer
Dim TotalBlank As Integer, R As Integer, C As Integer
Dim BadSheet As Boolean, ImpFail As Boolean
Dim tmp, tmpType, tmpCtr, tmpRsn
If Forms![Import Block Vouchers]![Import Program] = "0" Then
MsgBox ("You must select a Program to load.")
ObjXLApp.Quit 'Exit from MS Excel
Exit Function
End If
View 5 Replies
View Related
Jun 17, 2005
I have an Access DB that I created in Access XP. It works perfectly when used in Access XP. When used in an Access 2003 environment some of the functions don't work anymore. I have users who use Office XP and users who use Office 2003. Does anybody know how to make this DB work in Access 2003 without having to do wholesale code changes?
I have already changed the security to "Low" to bypass the security feature built in in Jet 4.0 but it didn't help. I might have to uninstall Windows XP SP2 to make it work because I know that the application works in an Office 2003 environment with Windows XP SP1 only. But I'm trying to avoid having to uninstall XP SP2 because it's a pain. Any ideas would be greatly appreciated.
Thank you.
My workstation environment is as follows:
OS: Windows XP SP2
Office: Office 2003 SP1
Jet: 4.0
Raneil
View 2 Replies
View Related
Sep 14, 2005
Hi,
I've created a database in access 2003 with the default file format being Access 2000. Everything works fine on my computer and many others, all of whom are running different versions of access (2000, 2002 & 2003).
I have not had any problems with this database until recently and in the last few weeks we have had 2 users, both of them being Access 2000 users who have had the same problem.
The problem they are having is that when they click on any of the switchboard items, the buttons depress an then come back up again when the cursor is moved away, but nothing else happens - no action, no error message - nothing!!! Its the same for all of the buttons on the switchboard.
Does anyone know what is causing this? I have another computer with Access 2000 on it and this works fine, as it does on several other computers runiing Access 2000, I just cannot understand why it is not working on these 2 particular machine.......
Many thanks in anticpation.
Steve
View 3 Replies
View Related
Sep 20, 2005
I have recently installed access 2003 w/access 97 installed both are on my hard drive. When I create a new db in access 2003 it saves it in an access 2000 format. Does any one know why it does this?
Thanks--Appreciate any help
View 2 Replies
View Related
Dec 7, 2005
i am trying to use access 2000 database onto to access 2003. When i try to click design mode to change something it gives me this message:
You dont have permissions to modify.
If i run it on access 2000 it runs fine.
Someone please help.
View 5 Replies
View Related
Dec 28, 2005
Hello,
I have two questions related to deplying an Access project I have been working on.
1. I started developing the project in Access 2000, but midway upgraded to Office 2003 and so the remainder of the project has been developed in Access 2003. Things seem to be fine, except that in the top most title bar, after the project name, there appears the following text:
xxxxx: Database (Access 2000 file format)
where xxxx is the name of the .mdb file.
Why is this appearing and should I have done something or do something to make it a Access 2003 format?
2. I am at the point of deplying the db to a small group of users (about 5). Some of them may have Access 2000 or Access 2002. Should I be doing something in particular to make sure things work in their machines.
Any pointers to what may be problems or what I should do will be much appreciated.
Thank you.
View 2 Replies
View Related
Sep 27, 2006
Hi,
A few years ago I’ve made an access database on access 2000. The problem is that now I’ve installed the office 2003, and I can’t make the database work properly.
At first says that are missing those files: “tshoot.ocx”, “msioff9.ocx” and “msowc.dll”; so, I’ve copy them from another computer using office 2000 and now only complains about “msioff9.ocx” saying that my database contains a reference incomplete to it.
Is there no other way to convert my database do work properly with access 2003? What can I do?
Regards
View 2 Replies
View Related
Nov 7, 2006
I have an Access db that is going to be shared by two different users. One user has Access 2003 and the other has Access 2002. Will there be any problems using this setup if both the users are accessing the MDB file at the same time?
Thanks,
CR Junk
View 4 Replies
View Related