Formula problems w decimal places

K

Kevin Bogart

I've written a formula that sums the values entered in fields on an infopath
form, and a couple of fields are multiplied by a decimal value that often
yields a decimalized value for the calculation. However, that sets off data
validation problems, as the calculated field continues to to insist that it
not have a decimalized value. Trouble is, the Access database field which
will be populated by the field is set to allow decimal places. How do I force
Access to accept the decimal places?

Thanks!

Kevin
 
S

S.Y.M. Wong-A-Ton

What is the data type of the fields in InfoPath? What does your
multiplication formula look like? Is your problem the amount of decimal
places InfoPath produces, while your Access database only accepts for example
2?
 
K

Kevin Bogart

Text boxes in InfoPath. I dont know if it will or won't hit the access db
correctly after submission -- i can't get the red "warning" dotted lines to
go away.

Formulas are:

@QSR_--_Hours + @SOR_--_Hours + @PLR_--_Hours + @Other_Flying_--_Hours

and

@Flying_Subtotal_--_Hours * 1.75

-Kevin
.... where the names are
 
S

S.Y.M. Wong-A-Ton

Text boxes, yes. But what data type? When you double-click on the text box
and open the properties dialog box, what is the data type listed?

The red border means that validation of the data failed.
 
S

S.Y.M. Wong-A-Ton

"int" means whole number, so if the result of your multiplication contains a
decimal point, it won't be accepted by InfoPath, hence the validation error
you're receiving. Since the data types are greyed out, it means that the
fields are bound to the database. You need to correct the data type in MS
Access first and then bind your form again so that InfoPath can correctly
interpret the data types. The data type in MS Access must be "single" with
decimal places e.g. "2". This will be converted in InfoPath to
"optional_float", which will allow you to insert decimal points in numbers.
 
K

Kevin Bogart

"single" is not one of the options i have under "data type" in ms access...

-KJB
 

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