Suppressing Small Amounts When User Tabs In To Field?

P

PeteCresswell

viz: http://tinyurl.com/yd2ucqc

I've got both the query column and form control formatted as "0" w/no
decimal places.

The form's control is locked.

The control legitimately contains a very small number - like
0.0000000009313225746 for instance.

From what I can ascertain this results from a SUM() of a Double field.

Mea Culpa.... but it's too late to change the field type.

Is there any way we can just keep MS Access from showing that very
small number when the user clicks into the field?
 
B

Banana

If you don't need any decimal values, then a quick'n'dirty way is to
have the control's controlsource call a Int() function:

=Int([TheBadBoy])

This will round down/up the number.
 
C

Clif McIrvin

I almost didn't respond -- you have so much more experience than I; and
I have learned so much from your posts ... but:

I gather your control source is an expression containing a sum ...

Have you tried something along the lines of

IIF (sum()<some small number,0,sum())

???
 
J

Jeff Boyce

Pete

I'll chime in with an idea, too...

You could try 'coercing' the result inside your query (or another one based
on your query), using CInt() or ... (whatever would be the more appropriate
conversion)...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
P

(PeteCresswell)

Among Banana Republic's, Clif's, and Jeff's suggestions, is there
a clear preference performance-wise?

I was going to do the IIF thing, but thought I'd troll a little
in case there was something obvious that I had missed - and it
turned out there was....

My bias would be toward .ControlSource="=Int()". But I have no
clue why....

I guess it might come down to a discussion of whether coercion is
preferable in queries or controls.
 
P

(PeteCresswell)

Per Clif McIrvin:
I almost didn't respond -- you have so much more experience than I; and
I have learned so much from your posts ... but:

I write a lot of code but, trust me, I'm not the brightest bulb
on the tree.

I live in continual awe of some of the people that post here.
 

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