473,513 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add user and time stamp only to new records?

11 New Member
Hi Guys - I've got a SQL Server backend and access front end.

I suspect this is pretty simple, but I want to add created by and when info to new records in my database, and modified by and when, when records are updated.

My question is, how do I get add the created details to new records ONLY. So for eg. if record is new...... then do etc.

Hope this makes sense.

Thanks - Chris
Aug 16 '07 #1
5 1956
chrisdavies
11 New Member
My short term solution is to check whether the created info fields are null. I would like something more robust though...
Aug 16 '07 #2
missinglinq
3,532 Recognized Expert Specialist
You have inadvertently posted your question in the Articles section rather than in the Forum section of our site, so I have moved it across to the Forum for you.

Welcome to TheScripts!

Linq ;0)>
Aug 16 '07 #3
missinglinq
3,532 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   If Me.NewRecord Then
  3.      ' Place your here code for new records only
  4.   Else
  5.   'Place code here for existing records only
  6. End If
  7. End Sub
  8.  
Linq ;0)>
Aug 16 '07 #4
chrisdavies
11 New Member
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   If Me.NewRecord Then
  3.    ' Place your code for new records here
  4.   End If
  5. End Sub
  6.  
Linq ;0)>

Brilliant!!!! Cheers for that.

Chris
Aug 16 '07 #5
missinglinq
3,532 Recognized Expert Specialist
Glad we could help! I edited that a bit, by the way, in case there's something you only want to do for existing records! Note that anything in the Else clause will occur ever time you visit an existing record!
Aug 16 '07 #6

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

Similar topics

10
4713
by: Yang Li Ke | last post by:
Hi guys, Im about to build a script which will log visitor time spent on my website. I got a few ideas about this, maybe checking visitors ip and storing that info in db with time in and then...
5
6002
by: David C. Barber | last post by:
I'm trying to determine which user has locked a given record from VB6. I know I can use sp_lock and sp_who, and match up the data to determine which users have locked records in my database,...
7
19579
by: Don | last post by:
Hi all, With regards to the following, how do I append the datetimestamp to the filenames in the form? The files are processed using the PHP script that follows below. Thanks in advance,...
2
2503
by: vj | last post by:
I am not able to insert data , as i have one of the composite key as type of time stamp , which gets the current timestamp value. When two records are inserted with the same data in the composite...
3
2680
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
3
6403
by: fong.yang | last post by:
I have a textbox on my form label date/time. I also added a date/time column to my table as well. The table already contains records before the date/time column was added. How do I setup a...
6
13580
by: Mike Charney | last post by:
Is there a way to check a files date and time stamp from VBA in access. I have a need check a date stamp on a file that I am importing. Thanks in advance, Mike m charney at dunlap hospital...
7
4258
by: monomaniac21 | last post by:
hi i have a php site which allows users to save a cookie on their computer which stores their user id details and allows them to auto- login. i'm wondering whether this is safe, is it...
4
1349
by: MLH | last post by:
Suppose you're using a query to update or append many records in a large table. And suppose one of those fields is a T/D stamp table and you're using Now() to write its value. It is conceivable...
0
7257
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
7157
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...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
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
4745
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
3232
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
1591
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
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
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.