Date() as default value is error #Name?

eason

Registered User.
Local time
Yesterday, 19:40
Joined
Nov 3, 1999
Messages
31
I have a form in Access 2000 that was updated from Access97. The field Date in the table is set to Date/Time with ShortDate as the format. This table is link to an input form and the first field is Date. I have Date() set as the Defualt Value for this field. If works find on some of the computers but on a few computer it returns an error of #Name?. It also work fine in 97. I checked the BIOS and it is showing the correct date format of mm/dd/yyyy. I also had Service Pack 2 installed on all the PCs. Does anyone have a clue of what is going on???
 
If your field is named Date you need to change it, Date is a reserved word, that may be the problem but I doubt it. Look for missing references, try re-installing if not change Date() to Now()
 
The field name is Datetxt. I also tried the Now() function but that put the date and time in which makes it harder to query.
 
I highly suspect you have a missing library reference. But to fix the Now() problem to show only the date try this:

Format(Now(),"mm/dd/yy")
Or this:
Format(Now(),"mm/dd/yyyy")

Depending on the output you want.

HTH
RDH
 
I tried the Format also and I still get the same error proble????
 
Have you check the library references?

When you receive errors using common functions such as Date(), Format(), Left(), Right(), Mid() and others ..... I have always found the problem to be with "Library References".

RDH
 
Set the format to short date, the date portion only will appear, bear in mind that regional settings in Windows can also change short date to just a two digit year
 
I've had this problem before on a database that was being used for some time. I was given a more powerful computer and the problem appeared. If I switched back to the old PC then the problem went away. It seems that the more modern computers don't like Date() I got around this by substituting it for =DateValue(now()) which seemed to do the trick.
 
That worked!!! The =DateValue(Now()) solve the problem. Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom