473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

current user

Kay
Hi Guys

I have created a single database that resides on one computer. The
database has about 11 users which I have created using the ms access
security feature so that each user has to login with their own name and
password.

In my table I have a field called user which is represented by a text
box on my form. When storing a record I want to display the user who
first stored that particular record. I am using access 2000 and the
currentuser() in the text box does not seem to work

Any help will be appreciated

Mar 15 '06 #1
12 7890
A Field defined in the Record with =CurrentUser() as its Default Value has
worked for me. That is only updated when the record is created... it won't
be "user who last updated".

What do you mean "the currentuser() in the textbox"? If you clarify, someone
may be able to make a useful suggestion.

Larry Linson
Microsoft Access MVP

"Kay" <kh******@hotmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
Hi Guys

I have created a single database that resides on one computer. The
database has about 11 users which I have created using the ms access
security feature so that each user has to login with their own name and
password.

In my table I have a field called user which is represented by a text
box on my form. When storing a record I want to display the user who
first stored that particular record. I am using access 2000 and the
currentuser() in the text box does not seem to work

Any help will be appreciated

Mar 15 '06 #2
"Kay" <kh******@hotmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
Hi Guys

I have created a single database that resides on one computer. The
database has about 11 users which I have created using the ms access
security feature so that each user has to login with their own name and
password.

In my table I have a field called user which is represented by a text
box on my form. When storing a record I want to display the user who
first stored that particular record. I am using access 2000 and the
currentuser() in the text box does not seem to work

Any help will be appreciated

You should be able to put
=CurrentUser()
in the Default Value property of the textbox.
Mar 15 '06 #3
Kay
Im going to mess about with it a bit furthur but what I meant was I
entered currentuser() in the control source property of the text box

Mar 15 '06 #4
Kay
Guys, Ivetried that but it works for an unbound field only. On a bound
field it comes up as 0

Any suggestions please

Mar 15 '06 #5
I had a problem similar to this using CurrentUser() and for some
reason, the text boxes just would not update after the relevant field
was updated so I used:

AfterUpdate

txtBox = CurrentUser

minus the brackets and I've never had a problem since then. I found
the reason for this was that the DB didn't like updating the textbox
when another control was the focus for the AfterUpdate event and this
was pointed out to me in ths group. Hope this helps

Mar 15 '06 #6
Kay
Thanks dean, but this will update the field continuously but I need to
store the name of the user who saved that particular record. If another
user logs in and saves another record, I want to have the other users
name stored in the user field for the other record

Mar 15 '06 #7
Sorry Kay,

I created a User field in the relevant table and used the above process
to record who made changes against a particular record. I display this
on the form using a text box and by storing the Username in a field the
CurrentUser function applies only to the specific record that the user
is updating/changing.

Hope I haven't confused you on this (as I usually end up confusing
myself).

D...

Mar 15 '06 #8
Kay
Crystal Clear, Thanks alot dean Im just gona start playing about with
it for a moment and hope to get it working,

Mar 15 '06 #9
"Kay" <kh******@hotmail.com> wrote in message
news:11********************@z34g2000cwc.googlegrou ps.com...
Crystal Clear, Thanks alot dean Im just gona start playing about with
it for a moment and hope to get it working,

I am 100% sure this works.
However, I know that Access forms can become confused when you are working
with them - and in the worst case they can become irreversibly corrupted.
However, it might not be that bad.
Make sure that your field and textbox names are different:
For example, the field in the table is CreatedBy the textbox name is
txtCreatedBy and the default value is =CurrentUser()

If this is still not working, just take 30 seconds to create the most basic
of forms bound to the table, just to verify that what we are telling you
should (and normally does) work.
Mar 15 '06 #10
Kay
Thats a very good tip, I created another table and a form and put a
bound field in the form and the same currentuser() code in the default
value of the field works. It must be something wrong with my db

Mar 15 '06 #11
Kay
THANKYOU all for your help, I have got it to work. I feel very thick at
this moment because I just clicked the add button and realised that the
user field changed to the current user Doh! Thats all it took

Mar 15 '06 #12

"Kay" <kh******@hotmail.com> wrote in message
news:11*********************@j52g2000cwj.googlegro ups.com...
THANKYOU all for your help, I have got it to work. I feel very thick at
this moment because I just clicked the add button and realised that the
user field changed to the current user Doh! Thats all it took

Doh!
Mar 16 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
4
by: Dan Bart | last post by:
I am using an application which is a modification of IBuySpy Portal. It is using Forms authentication. Users login and their name is added to Context Then I use: ...
8
by: Mark White | last post by:
Hey everyone I'm having a great deal of problems finding this information through google and yahoo, so I turn to you on this. I have a Windows app running on XP. I am able to caputre the...
4
by: Leszek | last post by:
Hello! I have my webpage (ASP) in domain (IIS 6.0). I need to make a popup with fullname of current user. How can I do this? Maybe someone have any examples? Thanks!
0
by: davidr | last post by:
Hi, I been stuck on this for a week or more. So please help! I have a menu were a user can click a button and a user control is loaded into the page. A problem occurs when trying to load a...
1
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
4
by: Doogie | last post by:
Hi, I am using HttpContext.Current.User.Identity.Name to get a user id from a web application. I then use that as part of a name of a cookie I'm writing. 30 minutes later I do a refresh of this...
9
by: Alex | last post by:
Get the Name and Phone Number of the Current Windows User in a .NET Application I am writing a simple .NET (C#) application. It needs to "automatic" get the Name (last, first) and phone number...
13
by: bproddu | last post by:
Hi, I'm using Forms authentication for my web app. I've a custom Principal class that I would like to set to the HttpContext.Current.User after the Membership.ValidateUser() passes. I'm able to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.