Textbox with "!" if value is negative, or actual number if positive (AC2007)

Re: Textbox with "!" if value is negative, or actual number if positive (AC2007)

doesnt work for me lol

Edit: Works now. Changed the return type of the function to Integer.
 
Re: Textbox with "!" if value is negative, or actual number if positive (AC2007)

:D Which one doesn't work for you?

Edit : Ah, I see. All good! Any thoughts on why you can't encapsulated a single-character in quotes??
 
Re: Textbox with "!" if value is negative, or actual number if positive (AC2007)

The Format property supports a system where numeric values can be substituted by strings based on the value. Four options separated by semicolons are provided.

Positive;Negative;Zero;Null.

Each supports the same strings definitions as the Format function.

In this case it should have been:
#;/X

The forward slash is the literal escape forcing the next character to be displayed literally. Access will automatically change quoted strings to this syntax sometimes.

Sometimes it leaves out the backslash because it only needs to escape letters that mean something, generally those in the Date format strings, y,m,d,h,n,s but also some others (like X) for reasons I don't really understand. I suspect they may mean something in other languages.

The eight standard access colours can also be included in the four options.

For example this shows negative values inside parentheses and coloured red:

#;(#)[red]
 
Re: Textbox with "!" if value is negative, or actual number if positive (AC2007)

A perfect explanation, thank you Galaxiom! Will File > SaveAs... for future reference
 

Users who are viewing this thread

Back
Top Bottom