Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 25th, 2003, 08:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default Default Value in Table

Good morning,
I have a field in a table that is hidden. (It doesn't show up on any queries or forms.) I have the default value as "Date()" so that it will put in the date that the record is created. This works good, but I want to go up another level...I want that field to also update to the current date each time that record is modified. Is this possible? And if so please help me to understand how to accomplish this.
I appreciate any help anyone can give. :D

Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
__________________
Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old September 25th, 2003, 09:38 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Laura,

Try the following:

Private Sub Form_AfterUpdate()
   me.datefield = date()
End Sub

Change 'datefield' to your control's name.

Regards,

Beth M
 
Old September 25th, 2003, 11:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Hello Beth,
Thank you for the reply.
I tried this and I get a message stating that an error has occurred and it cannot save the record at this time. Then asks if I want to close the object anyways. Does it matter that my form is a in a datasheet view and not one record per page?


Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old September 25th, 2003, 11:11 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It doesn't matter what the view is, form or datasheet. But please provide more details about the data. Is the form bound to a table, query or was it a recordset returned by entering criteria in an unbound search?
 
Old September 26th, 2003, 04:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Sorry it took so long to reply...It has been a real hectic week!
TGIF!!!
I created a query based off my table simply for sorting purposes then based my form off the query. It's not a recordset at all...(I'm not very good at those just yet.) I do have a couple of combo boxes that are drop down lists based off of two other separate tables, but I wouldn't think that would matter.
If this isn't enough info or you need me to e-mail the database, please let me know.
I appreciate your help!

Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a List Box with Table Names & Table date hewstone999 Access VBA 1 February 27th, 2008 10:10 AM
default ambrosejp SharePoint Admin 2 April 20th, 2006 01:56 PM
Default the new record in a table while openning anukagni Access 5 January 9th, 2006 06:21 AM
(oracle 8i)Alter Table <table> coalesce partition combo Oracle 3 October 13th, 2004 09:35 AM
size of table (type table is table of number) MikoMax Oracle 1 November 19th, 2003 03:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.