473,387 Members | 1,899 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,387 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 1163
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.