Format text field as number???

S

Susan

I have a text field that has numbers if applicable and text (N/D) if not. If
there are numbers they could range from 100 to 10,000. If the number is
1,000 or greater, I want to add the comma....but no comma if it is just a
3-digit number or text.

I got it to ALWAYS put a comma, but I can't figure out how to only put one
for a 4 or 5 digit number and nothing else. Can someone please tell me how
to accomplish this?

Thanks!
Susan
 
J

John Spencer

In the underlying query, you could use

IIF(Len(SomeField & "" )<4, SomeField,Format(Val(SomeField),"#,000"))

You can use similar logic in VBA code in the report section.

Also, you might be able to use conditional formatting to do this.
 
Top