473,287 Members | 1,564 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,287 software developers and data experts.

Can I record the date that a status field in my table changes

MattFitzgerald
I have in my table a field OrderStatus and want to use the now() function or similar to record in a field DateStatusChanged the date and time the status was last changed. How can I do this? and can the code be in the table the data is stored in? or does it need to be in the form that the user is using to change the status?
Jul 17 '07 #1
5 1161
missinglinq
3,532 Expert 2GB
There is no "code" per se in tables. In the code module for your form:
Expand|Select|Wrap|Line Numbers
  1. Private Sub OrderStatus_BeforeUpdate(Cancel As Integer)
  2. Me.DateStatusChanged = Now
  3. End Sub
Welcome to TheScripts!

Linq;0)>
Jul 17 '07 #2
Thank you:

Expand|Select|Wrap|Line Numbers
  1. Me.DateStatusChanged = Now ()
above code worked just as I wished it to. Being the first time I have used code could you explain
Expand|Select|Wrap|Line Numbers
  1. Me.
(or a website that has a dictionary of code)

Is there similar code that can be used to give a changed date if any part of a record is updated rather than targeting a specific field?
Jul 18 '07 #3
missinglinq
3,532 Expert 2GB
Putting the same code in

Private Sub Form_BeforeUpdate(Cancel As Integer)

will timestamp changes made anywhere on the record when the record is saved.

The Me. is a kind of shorthand, if you will, for the name of the current form.
If you're writing code in the code module for a form named

MyMostFineAndIllustriousForm

and referring to, say a control on that form named

MyTextBox

you could write

MyMostFineAndIllustriousForm.MyTextBox

or you can simply write

Me.MyTextBox

Same thing with, say, requerying the form. Instead of

MyMostFineAndIllustriousForm.Requery

simply

Me
.Requery

Linq ;0)>
Jul 18 '07 #4
Thank you for answering my question and the further help in understanding it.
Jul 18 '07 #5
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Jul 18 '07 #6

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

Similar topics

5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
6
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
5
by: robecflo | last post by:
Hi Forum, i have a problem, hope somebody can give me ideas. I'm developing with windows forms and vb.net, and oracle as a database. At this moment i have a table called amortizaciones, this table...
6
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
1
by: rdraider | last post by:
Hi all, We have an app that uses SQL 2000. I am trying to track when a code field (selcode) is changed on an order which then causes a status field (status) to change. I tried a trigger but...
1
by: Wes Brooks | last post by:
Hello expert, Please help me with the following problems. I have spent ages to resolve them but no luck. I have two forms. (1) "Document Reception Input Form" is the main form. The search...
8
by: ivijayan | last post by:
HI. I have the following query:- How do i create field which updates its contents on the basis of data in another field in same record. especially if I have a Date field, how can I change the...
1
by: Becky99 | last post by:
In the database I'm working on (2003) I have a client table that includes a client status field, and I have a linked notes table that includes the note entry date, note type, and note details. Each...
25
by: tekctrl | last post by:
Anyone: I have a simple MSAccess DB which was created from an old ASCII flatfile. It works fine except for something that just started happening. I'll enter info in a record, save the record,...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...

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.