Date() as default value is error #Name? (1 Viewer)

eason

Registered User.
Local time
Today, 05:26
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???
 
R

Rich

Guest
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()
 

eason

Registered User.
Local time
Today, 05:26
Joined
Nov 3, 1999
Messages
31
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.
 

R. Hicks

AWF VIP
Local time
Today, 05:26
Joined
Dec 23, 1999
Messages
619
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
 

eason

Registered User.
Local time
Today, 05:26
Joined
Nov 3, 1999
Messages
31
I tried the Format also and I still get the same error proble????
 

R. Hicks

AWF VIP
Local time
Today, 05:26
Joined
Dec 23, 1999
Messages
619
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
 
R

Rich

Guest
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
 

saintsman

Registered User.
Local time
Today, 11:26
Joined
Oct 12, 2001
Messages
138
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.
 

eason

Registered User.
Local time
Today, 05:26
Joined
Nov 3, 1999
Messages
31
That worked!!! The =DateValue(Now()) solve the problem. Thank you very much.
 

Users who are viewing this thread

Top Bottom