Using expression buiolder to format a field

A

AJ

Is there a way to use expression builder on a report to format a field to
currency?
I have a field on a report that can be alphanumeric or numeric. If it is
numeric I would like to format the data to currency (commas and $). Currently
this report will not let me do this in the normal means because as I
mentioned, it can be alphanumeric so I cannot jsut chnage the property to
currency.

Can this be done?
 
D

Dirk Goldgar

AJ said:
Is there a way to use expression builder on a report to format a field to
currency?
I have a field on a report that can be alphanumeric or numeric. If it is
numeric I would like to format the data to currency (commas and $).
Currently
this report will not let me do this in the normal means because as I
mentioned, it can be alphanumeric so I cannot jsut chnage the property to
currency.

Can this be done?


Answered in another group to which you independently posted the same
question. That's called "multiposting", and it's generally frowned on
because others don't know what answers have already been given, and so they
duplicate the effort. Also it's harder for you to keep track of the various
replies, and it's harder for later readers of the question, who may be
looking for the same answer, to learn what they need.

In most cases a single, well-chosen newsgroup will do. If your question
really is relevant to more than one newsgroup, the approved technique is to
"crosspost" it instead, by listing multiple newsgroups in the To: or
Newsgroups: line of a single message. If you do that, the message and any
replies will appear in all the listed newsgroups automatically, which is
beneficial to all concerned.
 
M

Marshall Barton

AJ said:
Is there a way to use expression builder on a report to format a field to
currency?
I have a field on a report that can be alphanumeric or numeric. If it is
numeric I would like to format the data to currency (commas and $). Currently
this report will not let me do this in the normal means because as I
mentioned, it can be alphanumeric so I cannot jsut chnage the property to
currency.


I suppose the builder could be used, but why bother.

To get a text box to display two diffent ways, use the IIf
and Format function in the expression:

=IIf(IsNumeric(field), Format(field, Currency), field)

Note that the IsNumeric function might not be infalible if
yout text values look like any of Access' allowable number
styles, e.g. 12E3 and 12D3 are both alternate ways to write
12000
 
A

AJ

Dirk -
I apologize for the multiple post. The first one, I received an error.
(Which I seem to get a lot when I post a question.) So I posted it again
without realizing it had already been posted.
I have posted many questions in this newsgoup and truly appreciate all the
help I receive from you and all the others. You will see from my past
behavior that this is not a common occurance, but rather the error mentioned
above.
Thank you for your answer and have a nice weekend!
 
D

Dirk Goldgar

AJ said:
Dirk -
I apologize for the multiple post. The first one, I received an error.
(Which I seem to get a lot when I post a question.) So I posted it again
without realizing it had already been posted.

No problem, AJ; I didn't mean to sound harsh. Lots of people don't realize
they *can* crosspost when appropriate, while others just don't understand
the etiquette.
 

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