Problem with Decimal separator

radek225

Registered User.
Local time
Today, 08:53
Joined
Apr 4, 2013
Messages
307
I have problem in DAO.Recordset when I want to take value with decimal numbers because In my region we have "," instead "." so Ms Access shows an error "comma in your sentence..." I need take a value eg. 12313,4345 (sna). I tried Replace function but it doesn't work:/ I don't want to round my value:/. What should I do?

Code:
if recIn!id_rozklad = DLookup("Id_Rozklad", "tblRozklad", DMin("sna", "tblRozklad")) then ...
 
Your DLookup is wrong for a start. Next the words "does not work", does not make any sense. Explain what is the error, error description.
 
The Where part of your Dlookup is not complete, the field name is missing.
I think it should be:
Code:
DLookup("Id_Rozklad", "tblRozklad", [COLOR="Red"]"sna = " &[/COLOR]  DMin("sna", "tblRozklad"))
 
Your DLookup is wrong for a start. Next the words "does not work", does not make any sense. Explain what is the error, error description.
Run-time error '3075'
syntax error (comma) in a query '4,6666666666'

It's not exactly the same message because I don't have english language pack.

The Where part of your Dlookup is not complete, the field name is missing.
I think it should be:
Code:
DLookup("Id_Rozklad", "tblRozklad", [COLOR="Red"]"sna = " &[/COLOR]  DMin("sna", "tblRozklad"))
The same error in both situation:

Code:
DLookup("Id_Rozklad", "tblRozklad", DMin("sna", "tblRozklad"))
and
Code:
DLookup("Id_Rozklad", "tblRozklad", "sna = " &  DMin("sna", "tblRozklad"))

Recordset can't understand
Code:
4[COLOR="Red"],[/COLOR]6666666666

but I can't change decimal point in Ms Access without changing all regional settings:/. In my region "," is correctly so In tables and forms Ms Access also shows "," like a decimal point, but when I want to use value in Recordset then Ms Access shows an error:/ which I mentioned at the beginning
 
Last edited:
Even with the language differences, I've never seen an access error that specified a 'comma' was missing.
The nearest you normally get would be a missing operand. I think you may be making the assumption it's the comma but that it isn't.

Are you absolutely sure sna is a numeric field?
 
Even with the language differences, I've never seen an access error that specified a 'comma' was missing.
The nearest you normally get would be a missing operand. I think you may be making the assumption it's the comma but that it isn't.

Are you absolutely sure sna is a numeric field?

It's not about language differences it's about region differences. Yes it's numeric field as double.
 
In regions with comma as the decimal separator, functions often use the semicolon as the argument separator.
 
You can wrap your DMin Expression using the Str() function.

Code:
DLookup("Id_Rozklad", "tblRozklad", "sna = " & [COLOR="Red"] Str[/COLOR](DMin("sna", "tblRozklad"))[COLOR="red"])[/COLOR]

works ok in my test

JR
 

Users who are viewing this thread

Back
Top Bottom