Q:

Access VBA Dmin and Dmax on comma seperated decimals

My system is using , as decimal seperator and . as thousands.
When i use the Dmin and Dmax functions in VBA, i get the error:
run-time error 3075 syntax error (comma)

While running this:-
UpperPower = DMin("Column2", "t_table", "Column2" & ">=" & RatedPower)

Where RatedPower is a function variable declared Public RatedPower As Double.
The function is declared double as well.
Everything else works fine with the comma being the decimal seperator.
I have looked into the replace function but I am not sure how to use it in the Dmin function...
What can i do?
Best Regards, Emil.

A:

This will work:
UpperPower = DMin("Column2", "t_table", "Column2 >= " & Replace(RatedPower, ",", "."))

Since the first argument to Replace() must be a string, RatedPower is implicitly converted to a string using the local decimal separator (if non-integer) and no thousands separators.
This code is foolproof, in that it works regardless if the local decimal separator is "." or ","

