Link to home
Start Free TrialLog in
Avatar of jmantha709
jmantha709

asked on

Linked Foxpro table error : Decimal field precision too small

Hi Experts,

I'm using an Access 2000 database with Access 2003 SP1.  I linked some Foxpro tables via ODBC.  Most tables work just fine, but there's one that gives me the error "The decimal field's precision is too small to accept the numeric you attempted to add."

This error occurs on just a few records.  I'm able to open the table and see my data except for those few records, they show as "#Error"

I need these tables to be linked and can't change their design as they are used be another application wich can't be updated...

Any ideas ?

Thanks

Avatar of SimonLarsen
SimonLarsen

Assuming that you are entering data into a form which is bound to the linked table.

On the appropriate controls set an event to format the value to the acceptable precision.

This could be a matter of checking the foxpro field for it's datatype and then looking up the acceptable values for that datatype then using either format or one of the Type Conversion Functions (check access help for them). For example

s = Format(13.9999999, "0.0000")

s is now a string with value 14.0000

I'm guessing a string ought to implicitly convert to a number. If not you can use the apprpriate type conversion and then put that into the field.
Avatar of jmantha709

ASKER

This solution doesn't work because the error arrives before the format function

s = Format(MyField, "0.0")

As soon as I try to retrieve the value of MyField I get the error, so I can't use it in any way.
ASKER CERTIFIED SOLUTION
Avatar of SimonLarsen
SimonLarsen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial