Hold Numner in access

J

Joe Mills

Hi all

I am having a problem with numbers in access
Examble

Dim s As inteerget
s = "1.5"
I get s =2 in debug mode how can i get it to say 1.5 and net 2?

Kenneth
(e-mail address removed)
 
J

JohnFol

An integer is a whole number. You are assiging a decimal to it.

Look at decimal / single / double
 
J

John Vinson

Hi all

I am having a problem with numbers in access
Examble

Dim s As inteerget
s = "1.5"
I get s =2 in debug mode how can i get it to say 1.5 and net 2?

An Inteerget (English Integer) is, by definition, a whole number. 1
and 2 are integers; 1.5 is NOT an integer.

Use Dim s As Float <or whatever the Dutch word is, sorry I don't know>
s = 1.5

You also do not need the quotemarks - they tell Access that you are
defining a String constant; you don't want a string, you want a
number. Access will translate the string to number when you assign it
to a variable but it's an unnecessary extra step.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top