M
mo
The following code works perfectly on my pc (with regional settings for UK).
Decimals are therefore saved as 3.65 etc. However, the Db is meant for Italy
where regional settings mean that the same decimal is 3,65.
To test whether the code below is working, I changed the regional settings
for my pc to Italian. The code now gives me a runtime '3075' error, telling
me that the is a 'syntax error (comma) in query expression 'DateOfMerge >=
#1/1/2003# AND DateOfMerge <=#31/12/2003# AND (FreeT4) <=7,15'.
I know that it is the comma portion of the '7,15' that is giving me the
problem.
My question is this: Are decimals always going to give me problems like this
and if so is there a straightforward solution?
I'm sure that when I tested the same code when I was in Italy a few weeks
back, everything was fine on a Italian PC with the Italian version of
Windows2K, Office2K and regional settings for Italy.
Can someone please enlightten me as to what exactly the rules are here.
Thanks very much.
------------------------------------------Code------------------------------
------------------
strSQL = "SELECT Surname, Forename, DoB, DateOfMerge, FreeT4, TSH,
SampBarCode "
strSQL = strSQL & "FROM TBL_REGISTRATION0003 "
strSQL = strSQL & "WHERE DateOfMerge >= #" & Month(Me!txt_start_date) & "/"
& Day(Me!txt_start_date) & "/" & Year(Me!txt_start_date) & "#"
strSQL = strSQL & " AND DateOfMerge <= #" & Month(Me!txt_end_date) & "/" &
Day(Me!txt_end_date) & "/" & Year(Me!txt_end_date) & "#"
strSQL = strSQL & " AND TSH >= " & (Me!txt_TSH) & ""
strSQL = strSQL & " AND FreeT4 <= " & (Me!txt_FT4) & ""
strSQL = strSQL & " ORDER BY DateOfMerge, Surname ASC"
Decimals are therefore saved as 3.65 etc. However, the Db is meant for Italy
where regional settings mean that the same decimal is 3,65.
To test whether the code below is working, I changed the regional settings
for my pc to Italian. The code now gives me a runtime '3075' error, telling
me that the is a 'syntax error (comma) in query expression 'DateOfMerge >=
#1/1/2003# AND DateOfMerge <=#31/12/2003# AND (FreeT4) <=7,15'.
I know that it is the comma portion of the '7,15' that is giving me the
problem.
My question is this: Are decimals always going to give me problems like this
and if so is there a straightforward solution?
I'm sure that when I tested the same code when I was in Italy a few weeks
back, everything was fine on a Italian PC with the Italian version of
Windows2K, Office2K and regional settings for Italy.
Can someone please enlightten me as to what exactly the rules are here.
Thanks very much.
------------------------------------------Code------------------------------
------------------
strSQL = "SELECT Surname, Forename, DoB, DateOfMerge, FreeT4, TSH,
SampBarCode "
strSQL = strSQL & "FROM TBL_REGISTRATION0003 "
strSQL = strSQL & "WHERE DateOfMerge >= #" & Month(Me!txt_start_date) & "/"
& Day(Me!txt_start_date) & "/" & Year(Me!txt_start_date) & "#"
strSQL = strSQL & " AND DateOfMerge <= #" & Month(Me!txt_end_date) & "/" &
Day(Me!txt_end_date) & "/" & Year(Me!txt_end_date) & "#"
strSQL = strSQL & " AND TSH >= " & (Me!txt_TSH) & ""
strSQL = strSQL & " AND FreeT4 <= " & (Me!txt_FT4) & ""
strSQL = strSQL & " ORDER BY DateOfMerge, Surname ASC"