Number Field Problem

  • Thread starter Thread starter Ger
  • Start date Start date
G

Ger

Hi all,

I have a database in which i added 2 new fields one is a currency field
and the other is a number field. I'm then passing in values to these
fields from a vb6 application. The currency value passes in perfectly
but the number value doesn't. If i change both fields to number neither
of these values are posting to the table BUT if i change both fields to
currency then both values are passing in correctly. The code does not
produce any errors.

Heres the code passing in the values:

oRS_Invoice("Discount_Rate") = Val(dblDiscountRate)
oRS_Invoice("Discount_Amount") = Val(dblDiscountAmt)

Any Ideas anyone?
 
What's the 'Field Size' property of the 'Number' field? If you didn't
specify a field size, then it will default to Long Integer, which will
produce the behaviour you describe if you are attempting to save fractional
values. Try changing the 'Field Size' property to Double.

(This is a flaw, or at least an idiosyncrasy, in the Access UI design in my
opinion. It doesn't, in my view, make sense to call 'Currency' a 'data type'
while calling 'Long Integer', 'Double', etc. 'field sizes'. But that's the
way it is.)
 
Thanks for that Brendan that did the trick.
Very Useful info i hadn't noticed that flaw.

Thanks Again

Ger
 

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

Back
Top