Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date() as default in table is giving errors

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
I am trying to use the Date() function in the default property, as I have in many databases, but for some reason I am getting an error that it doesn't recognize the funtion. Is this due to an object library. I can't imagine it is, but I can't think of any other reason it won't recognize the date function. If I put now() it works, but I don't want the time in there as now() will put. Any ideas?

Thanks
Dawn
 
That will not work because it will think that it is text and give me data mismatched error. Date() IS the proper function, I use it all the time. It is just this database that is rejecting it. Thanks.
 
just a guess..sounds kinda strange, esp since you have used it so many times before...I just tried it and it worked fine...using Access 2000...could be a library...I have ADO, Object Library, VB and OLE libraries loaded...
 
Try int(now()) - it should be the same as date(). This is just a workaround.

You you have a field named Date ?
 
iv'e even seen format(date(),"mm/dd/yy")
 
Thanks for the ideas. Here is the work around that seems to work for many issues: I created a new database and imported the objects over and it worked fine. Hmmm. Thanks again. Dawn
 
Dawn,

You lost a reference to the correct code library. Add a reference to ANY code library save and reboot. Reopen Access and remove the new reference. You should find Date now forks.

Craig
 
Thanks Craig, I will keep that in mind for next time. Like I said, creating the new database was quick and easy and worked :) But it is good to know that there is another solution, as I am sure it will happen again.
 
I've had problems distributing apps in a company where everyone uses Access 2000, but different ghost images on the PC's can result in different versions of client MDAC, usually varying between ADO 2.5 and 2.6. Simple things like the Left function won't work--sounds like your Date() problem. So, I've found that setting reference to ADO 2.1 fixes this. Some versions of the MDAC play better with others than others do.

Look at: C:\Program Files\Common Files\SYSTEM\ADO\msadomd.dll and the version property of this file.

Keep track of the versions on your development machines if you work on more than one (e.g. work/home).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top