need help

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

I am not good in programming , I would be appriciated if somebody help
me with this:
I have data from Acces how can I ask the software to format the number
above 100 with two digit e.g 45.23 and above 100 without any digit like
1,123,100 ?
Thanxx
 
Hi Alex,

Where is the number? In a report? On a form?

The Format code must be changed depending on the value of
your number; there is not way to put conditions like this in
the Format property


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Supplementing what Crystal said: you can't do this with the Format
property (e.g. of a field or textbox). It needs an expression like this
(e.g. as the ControlSource of a textbox):

=IIf(Abs(XXX)<100, Format(XXX, "0.00"), Format(XXX, "#,##0"))

replaceing XXX with the name of the field in [square brackets] or the
name of the variable, as the case may be.
 
if this is on a report and you are adding the numbers, you
can use the section OnFormat event to test the magnitude and
set the format property with code -- leaving the value still
a number

on a form, you can use the form onCurrent event and the
AfterUpdate event of the number if you need a number not a
string, or you need to be able to change it

As John suggested, Format is an easy way and if you don't
need the value to stay a number; Format makes it a string

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com



John said:
Supplementing what Crystal said: you can't do this with the Format
property (e.g. of a field or textbox). It needs an expression like this
(e.g. as the ControlSource of a textbox):

=IIf(Abs(XXX)<100, Format(XXX, "0.00"), Format(XXX, "#,##0"))

replaceing XXX with the name of the field in [square brackets] or the
name of the variable, as the case may be.


I am not good in programming , I would be appriciated if somebody help
me with this:
I have data from Acces how can I ask the software to format the number
above 100 with two digit e.g 45.23 and above 100 without any digit like
1,123,100 ?
Thanxx
 
Back
Top