Problem! (1 Viewer)

star777

Registered User.
Local time
Yesterday, 22:43
Joined
Jul 20, 2018
Messages
15
Even more reason to add these codes to a table with a description then.

I would probably paste them into excel and manipulate the text to create the correct layout, then paste as a new table back into access.

Hi Thank you again.
no idea how to do that. new programmer!
 

star777

Registered User.
Local time
Yesterday, 22:43
Joined
Jul 20, 2018
Messages
15
Just to chip in with a relatively minor comment : Companies.Disabled looks and sounds to me like a Boolean. Can it have values other than 0 or 1 ? If not then define it as a Boolean and use True and False as its values rather than 0 and 1. And I would also probably have used Companies.Enabled as the field name rather than .Disabled to avoid double negatives (e.g. "Enabled"/"not Enabled" is a bit easier to grasp than "Not Disabled/Disabled").


Hi Thank you.
yes it is field. but i have show the description instead of "PB" etc
 

June7

AWF VIP
Local time
Yesterday, 21:43
Joined
Mar 9, 2014
Messages
5,465
For the original question, try:

IIf(LOEVM = "X" Or SPERR = "X" Or SPERM="X" Or SPERQ IN("PA","PD","PE","QF",QG","QH"), 1, 0)

To show more descriptive text ("Vendor Moved" instead of "PA"), have a table of these values - 1 record for each unique value (a 'lookup' table) - and include the table in queries. That's the simplest approach. Otherwise need a long expression or custom function.
 
Last edited:

star777

Registered User.
Local time
Yesterday, 22:43
Joined
Jul 20, 2018
Messages
15
For the original question, try:

IIf(LOEVM = "X" Or SPERR = "X" Or SPERM="X" Or SPERQ IN("PA","PD","PE","QF",QG","QH"), 1, 0)

To show more descriptive text ("Vendor Moved" instead of "PA"), have a table of these values - 1 record for each unique value (a 'lookup' table) - and include the table in queries. That's the simplest approach. Otherwise need a long expression or custom function.


it work good thank you very much.
But how do I set COMPANIES.DISABLED. Can I create new field with dot(.)?

And also I want to show value PA with description (Vendor Moved)

For the selected vendors:
A) if at least one of the indicators LOEVM, SPERR, or SPERM ="X", set COMPANIES.DISABLED to "1"
ELSE
B) If SPERQ = one of the values below:
PA (Vendor Moved)
PD (Block for Duplication)
PE (Block for Commercial Issue)
QF (Disapproved)
QG (Inactivated)
QH (Unapproved)
set COMPANIES.DISABLED to "1"
ELSE:
C) set COMPANIES.DISABLED to "0".
 
Last edited:

June7

AWF VIP
Local time
Yesterday, 21:43
Joined
Mar 9, 2014
Messages
5,465
If it worked, why are you asking the same question?

What do you mean by 'set COMPANIES.DISABLED' - the expression is calculating the disabled indicator. There is no reason to save this value to table, just calculate when needed.
 

Users who are viewing this thread

Top Bottom