Conditional Formatting (1 Viewer)

Gismo

Registered User.
Local time
Today, 13:11
Joined
Jun 12, 2017
Messages
1,298
My apologies CJ_London. Works great (y)
I never tried this, so having a few issues, i copied the sample but still get error on the unbound control with 0.00;[red]"Status";[red]"Stock"

please help, no idea what to do, neither of my attempts are working

not

# =iff([OTR5C QRY]![Stock Avilable]>[OTR5C QRY]![Reqmt Qty1],"Stock") #

# =iff([OTR5C QRY]![Stock Avilable]<[OTR5C QRY]![Reqmt Qty1],"Shortage") #

nor 0.00;[red]"Status";[red]"Stock"

also not sure how to change 0.00;[red]"Status";[red]"Stock" if i need to compare from another field

i get below error
1596462128179.png
 

Gismo

Registered User.
Local time
Today, 13:11
Joined
Jun 12, 2017
Messages
1,298
oh, am i suppose to past this in format and not in control?
i just tried this
from a control result of 3, after format i get [0].[03]
1596462514855.png


what does the red stand for? does this highlight in red?
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:11
Joined
Sep 21, 2011
Messages
14,223
I used this
Code:
0.00;[red]"Shortage";[red]"Stock"
and yes it has to go in the format entry for the control.

Up to you to get the correct calculation to produce the correct result.?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 11:11
Joined
Feb 19, 2013
Messages
16,605
personally I would have

=[Stock Avilable]-[Reqmt Qty1]

as the controlsource to your control which will generate either a positive, negative or zero value, assuming neither of those two values are null

I don't know why you include the query name - these should be on your form.
 

Gismo

Registered User.
Local time
Today, 13:11
Joined
Jun 12, 2017
Messages
1,298
personally I would have

=[Stock Avilable]-[Reqmt Qty1]

as the controlsource to your control which will generate either a positive, negative or zero value, assuming neither of those two values are null

I don't know why you include the query name - these should be on your form.
this is what i used as my primary control but i need to replace the value output to a status of "Stock" or "Shortage"
 

Gismo

Registered User.
Local time
Today, 13:11
Joined
Jun 12, 2017
Messages
1,298
You can do something like this. I do not think you can use the format property to handle 0. I have two textboxes on top of each other to make this work.
i am now also trying the sample DB your provided
It seems to be exactly what i am looking for
the only problem is, even when i copy your code #=IIf([FieldValue]=0,"Stock",[FieldValue])#
and change accordingly,#=IIf([Status]=0,"Stock",[Status])#
it gives me an error

please could you advise,looking at the db you send, i seems this is what i need

1596522069516.png
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:11
Joined
May 21, 2018
Messages
8,525
Can you post a sample db? My guess is that you are not typing something correctly or you are placing in the wrong location. Is that a true cut and paste of what you typed? That error message can be associated with special characters.
 

Gismo

Registered User.
Local time
Today, 13:11
Joined
Jun 12, 2017
Messages
1,298
Can you post a sample db? My guess is that you are not typing something correctly or you are placing in the wrong location. Is that a true cut and paste of what you typed? That error message can be associated with special characters.
i actually copied the DB provided and changed the fieldvalue, then I get the error of the operand
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:11
Joined
Sep 21, 2011
Messages
14,223
What are these # characters that you keep on posting meant to be?
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:11
Joined
Sep 21, 2011
Messages
14,223
i was told to post my code between # #
No, you were asked to post code between code tags.?
In the old system, the icon to do that was a #, now it is as per my signature.
Alternatively I just write [ c o d e ] and [ / c o d e ] at the start and end of the code.

Note: Take the spaces out between [ and ] as writing it as normal would make it disappear.
 

Users who are viewing this thread

Top Bottom