473,721 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creation and update times

Hi all,
I am trying to add 4 fields to an existing table which will show record
creation date and time and record update date and time. I have managed to do
the creation date and time ok by adding a default value to the fields on the
form of =Now(). My problem begins when I try to get the updated field filled
in automatically. I just can't think how to do it.

Many thanks in advance for any suggestions

Mark
Nov 12 '05 #1
3 1464
Following on from my previous post. I have come up with the idea to add a
default value of Now() to the updated fields. Then set a rule to every other
field so that after update, run a query which updates the fields to Now().
My new problem is that I don't now how to set the criteria on the update
query so it only updates the current record!!!

Is this the right way to go? Is there a better/easier way to achieve this?

Mark

P.S. I know absolutely nothing about VB!!!!!
"Mark" <ma*********@nt lworld.com> wrote in message
news:A3******** **************@ newsfep2-win.server.ntli .net...
Hi all,
I am trying to add 4 fields to an existing table which will show record creation date and time and record update date and time. I have managed to do the creation date and time ok by adding a default value to the fields on the form of =Now(). My problem begins when I try to get the updated field filled in automatically. I just can't think how to do it.

Many thanks in advance for any suggestions

Mark

Nov 12 '05 #2
Attach a procedure to the form's before update event like this. Must
be before otherwise it will cascade.

me![fieldName] = now()

By the way you only need 2 fields if you are using now(). If you need
the date use date(fieldName) , if you need the time use
time(fieldName) .

neil
Nov 12 '05 #3
Sorry, it should be format([fieldname],"short date") &
format([fieldname],"short time") .

Neil
Nov 12 '05 #4

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

Similar topics

0
277
by: Fiona McBride | last post by:
Hi all, I have a really odd problem with some Visual Basic .NET 2003 code; I have a program that creates a number of windows which contain RichTextBox, Timers (disabled) and menus. The code runs fine and creates the windows as required, BUT if the program is left to do nothing for several hours, when it is brought back into focus it generates an exception error (Object reference not set to instance of an object - this always coincides...
0
1752
by: Support | last post by:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 11"> <meta name=Originator content="Microsoft Word 11">
1
1510
by: chettiar | last post by:
Hi, I am dropping an index and recreating it to lower the high water mark. The index creation is taking a lot of time. I am stuck as to why it does so. Is there any way that I can find out why it is doing so. Is there a snapshot that will help me while index creation. P.S. There are no users connected to the system when i m creating the index.
5
1816
by: George | last post by:
Hi, Is it possible to delay session creation in ASP.NET I want the user to browse my site without any session created (no cookies set). My pages will know that is Session = null then Session has not been created and they should not rely on it. But at the moment user puts something into shopping cart i want to trigger session creation (set the cookies) and from no own that user will have regular session. Is it doable with .NET Session or...
3
3096
by: Nick Dreyer | last post by:
I was quite surprised to notice that Sub New() gets called twice, once at declaration time and once at creation time. I can't figure out why it would be called at declaration if there is no class instance to work with. What is going on here: Sub Main Dim NewObject as MyClass MsgBox("Before Creation")
8
2745
by: Ankit Aneja | last post by:
Hi I have made a windows service in C#.Net Now I want to create a setup of this service http://www.codeproject.com/dotnet/simplewindowsservice.asp I read this article Now my service is also using com dll I also want that dll to be registered on server(or computer) on which that service will be installed How can i do that.I am using visual studio.net 2003
5
2590
by: MN | last post by:
Hello, I have a customer table and another table that I need to prepopulate with special customer IDs, unique and not sequential. Is there a way to configure Access to assign the customer ID to every record each time that a record is either created for the first time or imported for the first time? I would be importing into a temp table and then running an update query to copy the data to the customer table. Another confusing issue is...
0
1603
by: Hurricane | last post by:
I have my SQL database with a table that I am trying to have a gridview dislay with inline editing. It seems as if the dataset does not generate the apropriate update query, and therefore consequently the gridview does not automatically allow editing. I then try to change which update query that is selected being the dataRow, DataSet,dataTable or other DataRow And none of them work
3
2023
by: Limunski Magarac | last post by:
Hi all :) My apologies if I posted in the wrong groups, but I just jumped in MS SQL waters, so any guidance will be appreciated. What I'm trying to do is the following process: present operator with a web page (script) once filled with db name and username, script will create ..sql file
0
8840
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9064
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5981
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
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 we have to send another system
3
2130
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.