Solved IF statement in a report control source (1 Viewer)

JRMT

New member
Local time
Today, 03:23
Joined
Dec 3, 2020
Messages
23
Hi Sir's im trying to generate report using this code

=if([Inspection Section Remarks]="AWAITING PARTS",[Inspection Section Remarks] & " >> " & [InspRem] & "/ Dmd No " & [DemandNo] & " / Dmd Dt " & [DemandDate],[Inspection Section Remarks] & " >> " & [InspRem])

meaning if i choose awaiting parts in the form and put values there it will show the inspector remarks, demand date and demand number values in the report. but now i want to add "TRANSFER" in the form and when i choose transfer it will also show inspector remarks, demand date and demand number values in the report that i put there. i already Added "TRANSFER" but when i choose "TRANSFER" and put values in Inspector Remarks, Demand Date & Demand number then generate report it only shows the Inspector Remarks, how can i add "TRANSFER" in the above code so that it will also shows demand date and demand number.

the above code is put in the control source of a report then i tried to add this:
Code:
=if([Inspection Section Remarks]="AWAITING PARTS",[Inspection Section Remarks] & " >> " & [InspRem] & "/ Dmd No " & [DemandNo] & " / Dmd Dt " & [DemandDate],[Inspection Section Remarks] & " >> " & [InspRem]),
=if([Inspection Section Remarks]="TRANSFER",[Inspection Section Remarks] & " >> " & [InspRem] & "/ Dmd No " & [DemandNo] & " / Dmd Dt " & [DemandDate],[Inspection Section Remarks] & " >> " & [InspRem])

but not working please help me thank you.
 
Last edited by a moderator:

Gasman

Enthusiastic Amateur
Local time
Today, 01:23
Joined
Sep 21, 2011
Messages
14,238
Firstly it is IIF() ?
Secondly you appear to want to same output whether Remarks is Awaiting or Transfer?
You also need the False part of logic.

If you put the code within code tags </> it would be much easier to read for everyone.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 01:23
Joined
Jul 9, 2003
Messages
16,273
I've added code tags...

Now it's readable!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:23
Joined
May 7, 2009
Messages
19,229
=Switch([Inspection Section Remarks] LIKE "AWAITING PARTS*"
Or [Inspection Section Remarks] = "TRANSFER",
[Inspection Section Remarks] & ">> " & [InspRem] & "/ Dmd No " &
[DemandNo] & " / Dmd Dt " & [DemandDate], True,
[Inspection Section Remarks] & ">> " & [InspRem])
 

JRMT

New member
Local time
Today, 03:23
Joined
Dec 3, 2020
Messages
23
Firstly it is IIF() ?
Secondly you appear to want to same output whether Remarks is Awaiting or Transfer?
You also need the False part of logic.

If you put the code within code tags </> it would be much easier to read for everyone.
Yes Sir i want the same output whether it is awaiting parts or transfer.
if i choose awaiting parts and put values on it, it will show on the report and same as transfer.
 

JRMT

New member
Local time
Today, 03:23
Joined
Dec 3, 2020
Messages
23
=Switch([Inspection Section Remarks] LIKE "AWAITING PARTS*"
Or [Inspection Section Remarks] = "TRANSFER",
[Inspection Section Remarks] & ">> " & [InspRem] & "/ Dmd No " &
[DemandNo] & " / Dmd Dt " & [DemandDate], True,
[Inspection Section Remarks] & ">> " & [InspRem])
This Solved my problem Thank you so Much Sir Arnel
 

Users who are viewing this thread

Top Bottom