How to use a dash in format Property of a control (1 Viewer)

darbid

Registered User.
Local time
Today, 19:13
Joined
Jun 26, 2008
Messages
1,428
I would like to show "YES" if a control is not null or a "-" if it is empty or null.

From what I understand of the Format property this should be

Code:
"Yes";"-"
But Access removes the quotes from the second part.

So how can I use a "-" in the property?

Thanks guys in advance.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 03:13
Joined
Jan 20, 2009
Messages
12,853
The pattern is :
Postitive;Negative;Zero;Null

Maybe this:
"Yes";"Yes";"-";"-"
 

darbid

Registered User.
Local time
Today, 19:13
Joined
Jun 26, 2008
Messages
1,428
Hi and thanks for responding.

Actually my control source is a Date - from what I can tell so far it is acting similar to the instructions in the help files as if it was a text source.

Thus the Format differentiates between (null or nil string) and if there is something.

I think it is working?
 

darbid

Registered User.
Local time
Today, 19:13
Joined
Jun 26, 2008
Messages
1,428
scratch that I am wrong - you are right.

I was dreaming.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 03:13
Joined
Jan 20, 2009
Messages
12,853
The Format property is a curious beast with many different manifestations.

BTW. If you want to show the value in one of the positions of the +;-;0;Null form then use the ampersand. You can also use colours by placing the colourname in square brackets after the format information. eg:
&;&[red];"Nil";"N/A"

It will take literals if you place a backslash before them in a numerical format string.

Dates also work in the format property. Any of the letters y,m,d,h,n,s will format as date parts while others will be taken as literals (a backslash inserted before them).

Standard formats will be changed to their format name.

Just don't try to put a percent sign in there.
 

darbid

Registered User.
Local time
Today, 19:13
Joined
Jun 26, 2008
Messages
1,428
The Format property is a curious beast with many different manifestations.

BTW. If you want to show the value in one of the positions of the +;-;0;Null form then use the ampersand. You can also use colours by placing the colourname in square brackets after the format information. eg:
&;&[red];"Nil";"N/A"

It will take literals if you place a backslash before them in a numerical format string.

Dates also work in the format property. Any of the letters y,m,d,h,n,s will format as date parts while others will be taken as literals (a backslash inserted before them).

Standard formats will be changed to their format name.

Just don't try to put a percent sign in there.

Thanks again. The colours i might just use.
 

Users who are viewing this thread

Top Bottom