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 January 17th, 2005, 03:53 PM
Authorized User
 
Join Date: Aug 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Incorrect Date Value

Hi All,

I've created a small VBA routine for inserting the last date used in a datefield. the momen the datefield has the focus and this date field = NULL , the last date used must be inserted in this field.

The problem I encounter is always he adds December 30 1899 ???
while the last date used is infact January 5 2005 ,

Can any one help me ?

Thx
Stanny

 
Old January 17th, 2005, 05:34 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

(Now() returns the date and time, Date() just returns the date)

Code:
> Val(Format(DateAdd("d", -5, Date()), "yyyymmdd"))
Jaime E. Maccou





Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect syntax near '.' meraj ADO.NET 6 February 27th, 2012 01:01 AM
Incorrect NTLoginName Gikote ASP.NET 2.0 Professional 0 November 8th, 2006 11:25 AM
Incorrect syntax near '!' sinapra Classic ASP Databases 8 August 25th, 2004 02:15 AM
Incorrect Characters webguy Classic ASP Databases 1 July 4th, 2004 09:52 AM
Incorrect syntax...... Adam H-W Classic ASP Databases 8 June 21st, 2004 11:14 AM





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