Format a number field (1 Viewer)

wjburke2

Registered User.
Local time
Today, 12:55
Joined
Jul 28, 2008
Messages
194
I have form that allows users to update inventory and a automated module that updates inventory as invoices are entered. Boxes is a table field format double. Boxes = Onhand / quanity in box.

Now my automatic update processes calculates boxes each time it updates. I am ending up with fields with 4.66666666... this displays as ######## on reports and forms. In fact the user never needs to see more than two decimal places rounded.
I have tried several things. Including standard and fixed format. Although they display the correct format when the user goes to the field to update it it displays 4.66666666... and does not always put the cursor in the first position.

Is there a way to get this field to display 4.67, or 4 no decimal if its a whole number, like General format. Also have it only allow the user to enter 4.66, 4.5, or 4?
 

Alansidman

AWF VIP
Local time
Today, 12:55
Joined
Jul 31, 2008
Messages
1,493
Try opening your form in design view and setting the properties for the particular controls to two decimal places. Do the same thing in your reports.

Alan
 

wjburke2

Registered User.
Local time
Today, 12:55
Joined
Jul 28, 2008
Messages
194
I tried that and it still displays 4.666666666 when they click on the field. BTW I just found out it only does it when they click on the field not if they arrow to it.n I tried to attach picture but couldn't figure it out.
 
Last edited:

Alansidman

AWF VIP
Local time
Today, 12:55
Joined
Jul 31, 2008
Messages
1,493
Have you tried to change the properties in the underlying table?
 

wjburke2

Registered User.
Local time
Today, 12:55
Joined
Jul 28, 2008
Messages
194
Thanks again for your response. I did try that but it only changed the way I saw the data when I viewed the table. Valid types are long integer, integer, double... I did find a solution. I use the round method when I calculate the totals. This insures that only 2 decimal places are stored and also it gets rid of 4.999678 rounding it to 5 boxes. But thanks again for your suggestions.
 

Users who are viewing this thread

Top Bottom