Hi,
I'm writing a VBA access program that is to be used around the the department i work in. Now you would think being in Canada and only being for one department everyone would be using the Candian regional settings, but this is not the case. Some computers are using US and some Candian meaning the date varies by computer with mm/dd/yyyy and dd/mm/yyyy.
In my VBA i have an ADO object that doing a Query based on the date entered and if i understand correctly Access (2003)queries force the US date/time format. Now while i can easily write code to change my format to mm/dd/yyyy by picking apart my Candian date and switching it the month and day i run into a problem when someone else is using a machine with the US date format.
my Program does not check to see what the users regional settings are it just does the switch so someone using dd/mm/yyyy gets mm/dd/yyyy and someone using mm/dd/yyyy would get dd/mm/yyyy. So basically this fixes the problem with Candian regional settings but creates a problem with US regional settings.
So basically my question is can i check a users regional settings before doing this switch operation in an IF kind of like:
IF (regional setting = Canada) Then
change date format to US
Else IF (Regional Setting = US) Then
do nothing
Else
your SOL change you regional settings
End IF
Any opinions? or Suggestions?
~Thanks
I'm writing a VBA access program that is to be used around the the department i work in. Now you would think being in Canada and only being for one department everyone would be using the Candian regional settings, but this is not the case. Some computers are using US and some Candian meaning the date varies by computer with mm/dd/yyyy and dd/mm/yyyy.
In my VBA i have an ADO object that doing a Query based on the date entered and if i understand correctly Access (2003)queries force the US date/time format. Now while i can easily write code to change my format to mm/dd/yyyy by picking apart my Candian date and switching it the month and day i run into a problem when someone else is using a machine with the US date format.
my Program does not check to see what the users regional settings are it just does the switch so someone using dd/mm/yyyy gets mm/dd/yyyy and someone using mm/dd/yyyy would get dd/mm/yyyy. So basically this fixes the problem with Candian regional settings but creates a problem with US regional settings.
So basically my question is can i check a users regional settings before doing this switch operation in an IF kind of like:
IF (regional setting = Canada) Then
change date format to US
Else IF (Regional Setting = US) Then
do nothing
Else
your SOL change you regional settings
End IF
Any opinions? or Suggestions?
~Thanks