473,480 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

last updated - date AND user

jayme
83 New Member
is there a way to have my form automatically record when a record is changed? i figured how to make the date update JUST if you change a record, but i also wanted to have it record the user that was logged in and made that change as well.
currently i made a macro under BeforeUpdate event for the form for my LastUpdated field and it puts the date in when the record has been changed. i have a field for the UpdatedBy but it just fills in whoever is logged in at the time-it doesnt necessarily put the user that changed that record. hope that makes sense.
any ideas on how to have both fields update?
Apr 19 '07 #1
7 5155
Denburt
1,356 Recognized Expert Top Contributor
If you have user security in place for the database then you can simply call:

currentUser()

If you would like to know who logged into that P.C.

Environ("UserName")

There is also other methods Neopa has an example here where he pulls it out of the registry:
http://www.thescripts.com/forum/post2152274-2.html

There are also several examples in this thread:
http://www.thescripts.com/forum/thread621606.html
Apr 19 '07 #2
jayme
83 New Member
currently i am using CurrentUser() in that field but it doesnt update when someone edits a record. it just has who is logged in.
like-for the date the field is blank until i change something then hit save THEN it updates that field for the modified date. the user field doesnt necessarily change with WHO made the change. so i was thinking there had to be another way besides currentuser().
ill look more into those other links you posted-maybe those have the answer im looking for.
thank you!!
Apr 19 '07 #3
Denburt
1,356 Recognized Expert Top Contributor
I don't quite understand this:
it just has who is logged in.
Are you saying that you have a user account that several people use?

Environ("UserName") Will give you the person logged into that P.C.

Where are you using CurrentUser() are you placing this in the default value property, the control source, or VBA somewhere?

I usually use it in my form using VBA under the On Dirty property.
Apr 19 '07 #4
jayme
83 New Member
i did not know about the OnDirty event....learned something new-once again! thank you!! sorry for not being able to explain my problem very well-but your help is definitely appreciated! i tried the OnDirty property for that and it worked! thanks so much!! that's exactly what i needed!
Apr 20 '07 #5
Denburt
1,356 Recognized Expert Top Contributor
Glad I could help, makes my morning knowing your all set.
Apr 20 '07 #6
Denburt
1,356 Recognized Expert Top Contributor
Oh just noticed one more thing are you using "date AND user" or "Date/Time and user" FYI, If your in the VBA window Date() gives you the date and Now() gives you date time info. have a nice day :)
Apr 20 '07 #7
jayme
83 New Member
Oh just noticed one more thing are you using "date AND user" or "Date/Time and user" FYI, If your in the VBA window Date() gives you the date and Now() gives you date time info. have a nice day :)
i was just using the Date() but I might give Now() a try and see what works for us. great...thank you!
Apr 20 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

8
4875
by: Dan Matthews | last post by:
Hey everybody, I have an 2000 Access database that stores job listings from potential employers for a school. I would like to be able to display the date on a webpage the last time the database...
1
3210
by: Amanda | last post by:
Hi, hope you can help me with this one. If I want to get the date a page has been last modified, I can do something like .. document.write("<b>Last updated: "+document.lastModified+"</b>"); ...
8
1708
by: John | last post by:
Is there such a date/time? I see the Created date on the list of stored procs, but really want a Date Last Updated. After changing code for 3 hours, I tend to forget which procs I've worked on,...
12
8663
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
1
2063
by: eal1 | last post by:
Does anyone know how to have Access put the "last updated" date on a report? I have a table of our university's athletic events, grouped by each sport per page. I'm trying to get the report to...
2
6865
by: abprules | last post by:
Is there a way that I can create a "Last Updated by" field in MS Access. I know how to do the Date Last Updated but can't seem to find out how to record the user who last updated the info. ...
3
3422
by: kustomguitarist | last post by:
I'm working on updating a page for a club that I'm involved in at school. It's on an apache server and I am editing the .htm file through linux. Does anyone know a script that I could include in...
3
6259
by: MarcJoseph | last post by:
I have a database that is shared my multiple users who enter and update records on a weekly basis. Is there a way I can add a field to my main data table that will automatically generate the...
8
1919
by: rdemyan via AccessMonster.com | last post by:
Anyone have any ideas on how to determine when the back-end file (containing only tables) has been updated with new data. The date/time of the file won't work because it gets updated to the...
2
1608
by: Ade | last post by:
Hi, I am a complete novice to Javascript, so please excuse me if this is a simple task. I have been playing with frames in a test piece in a book I have, and one of them displays the data and...
0
7051
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
7054
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
6993
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...
0
4493
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.