Date() problem "doesn't always work on other machines"

pungentSapling

NeedHotSauce?
Local time
Today, 01:28
Joined
Apr 4, 2002
Messages
116
I have been noticing some problems when I use the Date() function in vba... It always works fine on my system but often will cause errors on other machines. Is there a reference that needs to be set in order for Date() to work?
Now() seems to work almost always??


thanks again
P
 
Check the references - it'll say if any are missing

Col
:cool:
 
some of the other pc's don't have american dates set.

Shot in the dark but worth a try.
 
When my database loads, I put in a region checker to see what region the machine is set to.

It compares a date like "1 Dec 2003" to what the machine thinks is the shorthand. If its "1\12\2003" I let them use the database. Otherwise, I get them to change their regional settings.

Not elegant, but it works. Also make sure that the date formats are consistent through the database. You can get into a real mess otherwise.
 
Thats quite a good idea Ian - taking it one step further, is there any way to pick up from windows control panel what the regional settings actually is?

Col
:cool:
 
How much do you like messing with the registry? I think that might be the only way to get at this information. I haven't found it though (but I am not familiar with the registry anyhow)

In Windows 2000, you can bring up the regional settings applet by running intl.cpl, but you can't get it to return you any information on the command line.

So, I plumped for the vb date checking code....

Anyone else got any ideas on this one?
 

Users who are viewing this thread

Back
Top Bottom