Hoping someone can help with this wild and wooly IIF statement..
fields in table:
1aPN, 1aSN
1bPN, 1bSN
2aPN, 2aSN
2bPN, 2bSN
I was using this statement in my query when I was only capturing info for 2 parts...
Part Info: IIf([1aPN]="NONE","NONE",IIf([1aPN] Is Null,"",IIf([2aPN] Is Null,[1aPN] & "; P/N " & [1aPN] & "; S/N " & [1aSN],"1) " & [1aPN] & "; PN " & [1aPN] & "; SN " & [1aSN] & Chr(13) & Chr(10) & "2) " & [2aPN] & "; PN " & [2aPN] & "; SN " & [2aSN])))
...but now I've added fields for parts 1b and 2b...
There's never data in 1b unless 1a has data, and never data in 2b unless 2a has data.
In short, I want to return PN and SN for each group (1a,1b,2a,2b) IF there's data in the PN field. If all four groups have data, it would look like this...
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2a) P/N: xxxx; S/N: xxxx
2b) P/N: xxxx; S/N: xxxx
It needs to always be in the order 1a,1b,2a,2b BUT nothing displayed if the field is Null, and "NONE" displayed if "None" is entered into 1aPN or 2aPN fields. For example:
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2) P/N: xxxx; S/N: xxxx
or
NONE
2a) P/N: xxxx; S/N: xxxx
2b) P/N: xxxx; S/N: xxxx
Ultimately, I would like the "a" and "b" omitted if there is only one part for either group 1 or 2. For example:
1) P/N: xxxx; S/N: xxxx
2) P/N: xxxx; S/N: xxxx
or
1) NONE
2a) P/N: xxxx; S/N: xxxx
2b) P/N: xxxx; S/N: xxxx
or
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2) P/N: xxxx; S/N: xxxx
or
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2) NONE
Thank you for any assistance!!
fields in table:
1aPN, 1aSN
1bPN, 1bSN
2aPN, 2aSN
2bPN, 2bSN
I was using this statement in my query when I was only capturing info for 2 parts...
Part Info: IIf([1aPN]="NONE","NONE",IIf([1aPN] Is Null,"",IIf([2aPN] Is Null,[1aPN] & "; P/N " & [1aPN] & "; S/N " & [1aSN],"1) " & [1aPN] & "; PN " & [1aPN] & "; SN " & [1aSN] & Chr(13) & Chr(10) & "2) " & [2aPN] & "; PN " & [2aPN] & "; SN " & [2aSN])))
...but now I've added fields for parts 1b and 2b...
There's never data in 1b unless 1a has data, and never data in 2b unless 2a has data.
In short, I want to return PN and SN for each group (1a,1b,2a,2b) IF there's data in the PN field. If all four groups have data, it would look like this...
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2a) P/N: xxxx; S/N: xxxx
2b) P/N: xxxx; S/N: xxxx
It needs to always be in the order 1a,1b,2a,2b BUT nothing displayed if the field is Null, and "NONE" displayed if "None" is entered into 1aPN or 2aPN fields. For example:
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2) P/N: xxxx; S/N: xxxx
or
NONE
2a) P/N: xxxx; S/N: xxxx
2b) P/N: xxxx; S/N: xxxx
Ultimately, I would like the "a" and "b" omitted if there is only one part for either group 1 or 2. For example:
1) P/N: xxxx; S/N: xxxx
2) P/N: xxxx; S/N: xxxx
or
1) NONE
2a) P/N: xxxx; S/N: xxxx
2b) P/N: xxxx; S/N: xxxx
or
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2) P/N: xxxx; S/N: xxxx
or
1a) P/N: xxxx; S/N: xxxx
1b) P/N: xxxx; S/N: xxxx
2) NONE
Thank you for any assistance!!