Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 30th, 2003, 11:36 AM
fdg1966 fdg1966 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 fdg1966 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
automatically update date in access

hello from italy!
I have a form with a date field that I want to update automatically the date evrytime the record is modified.
How I can do that in an easy way? I am a newbee so... If you can help me to solve this problem, I would be extremely thankful.
Thanks

Reply With Quote
  #2  
Old August 31st, 2003, 09:15 AM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 8 h 5 m 34 sec
Reputation Power: 20
If your database supports triggers, you can put one to update that column. If not, route all your commands through a stored procedure and do it there (triggers are nothing more than stored procedures that the db will automagically execute for you).
__________________

Left DevShed May 28, 2005. Reason: Unresponsive administrators.
Free code: http://sol-biotech.com/code/.
Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.

It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw

Reply With Quote
  #3  
Old September 3rd, 2003, 05:52 AM
a_sheldon a_sheldon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 a_sheldon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Another way of doing it is to insert the following code in any of the fields After Update property. This way when you alter the data stored in a field it will update the date in the date field.

txtdate.value = format(Now(),"dd/mm/yy")

(where txtdate is the name of text box that holds the date.)

That should work.

Reply With Quote
  #4  
Old September 3rd, 2003, 12:10 PM
siredge siredge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boise, ID
Posts: 9 siredge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Having trouble with Access & "=Now()"

I am trying to get a date-stamp to show up on a report. We originally designed the report in '97, and imported it into 2k, where it also functions properly. Now we've imported it into a 2k db using ODBC to link to Oracle and the function has stopped working. Any one know what is causing 2k to not recognize the "=now()" function?

Reply With Quote
  #5  
Old September 4th, 2003, 02:12 AM
a_sheldon a_sheldon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 a_sheldon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Try the =Date() function instead. If that doesnt work then I am unsure how to solve it.

Cheers

Reply With Quote
  #6  
Old September 4th, 2003, 11:11 AM
siredge siredge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boise, ID
Posts: 9 siredge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
We stumbled across that one and tried it also, but it won't recognize either one. Does anyone know if now() and date() are VB functions or access functions? Could that be part of the problem?

Reply With Quote
  #7  
Old September 5th, 2003, 02:36 PM
crimson117 crimson117 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: New York
Posts: 19 crimson117 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to crimson117 Send a message via AIM to crimson117 Send a message via Yahoo to crimson117
Quote:
Originally posted by siredge
We stumbled across that one and tried it also, but it won't recognize either one. Does anyone know if now() and date() are VB functions or access functions? Could that be part of the problem?


Oracle uses a global reserved variable called SYSDATE.

You can query with it, such as

select * from myTable where reportDate < sysdate


What reporting tool are you using? It may have a timestamp feature built-in if all you need to do is print the date on top of the report.

If you're using Access reports, make a text box with the Control Source/value of =Now()

Last edited by crimson117 : September 5th, 2003 at 02:39 PM.

Reply With Quote
  #8  
Old September 5th, 2003, 03:23 PM
siredge siredge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boise, ID
Posts: 9 siredge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Fixed it

The problem wasn't in Oracle at all- we had some corrupted VB code that was interfering with all the VB functions used by the report in question. We made a copy of the DB without the corrupted module and the report (which fortunately didn't need the code) began functioning properly.

Thanks for the help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > automatically update date in access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway