Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 18th, 2004, 09:08 AM
Registered User
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default Values

I want to set a date and time stamp so I set up a field in the table and fill in the Default Value as =Now() (I have tried just Now()) on a text field (I have tried a Date field). I then save the change close and reopen the table add a new record.....no date and time & stamp, I then check the design and no default set!

I have tried to be as methodical as possible but must be doing something stupid but I can't see what.

Can anybody help?

If you can help on this please look at my posting of last week.

Reply With Quote
  #2 (permalink)  
Old October 18th, 2004, 11:25 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts


   Try designing a quick table, put in an autonumber PK, a text field, and use the following for your date field:
Field Name: DateTime
Data Type: Date/Time
Default Value: =Now()

   Save and open the table. The Date/Time should automatically populate the DateTime field.

   If you are opening the table in a form, and the DateTime field is not on the form, try putting it on the form and setting visible to No or False for that field. Make sure it is high in the tab order for good measure.

Does this help?

Reply With Quote
  #3 (permalink)  
Old October 19th, 2004, 05:57 AM
Registered User
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks MMcDonal that is exactly what I did just after I posted my query. Guess what.....it worked, it was then that I noticed something about Now() in a default. The Now() is set in the next record so that when it is created it shows the time of the last creation (now I concede that I may be doing something really stupid but try it and see if I'm right). I have decided to write a VBScript which I'll attach to the new record button on the toolbar in a DAP.

Any takers for my posting of last week which poses me a greater problem (If I can't solve it I will be migrating my work to PHP/MySQL)

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Field Values tachtenberg Reporting Services 1 February 19th, 2008 05:52 PM
Default Values On Fields hossrad SQL Server 2005 2 May 15th, 2007 02:27 AM
setting default values prithvi28 XSLT 1 October 3rd, 2006 01:38 PM
Default Values for Query Odifius Access VBA 3 September 20th, 2006 06:30 AM
Default values? Raymie_C Access VBA 2 May 16th, 2005 11:48 AM

All times are GMT -4. The time now is 06:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.