Using access 2003, I am trying to write a SWITCH statement for a report header. I have a field TRADE which changes value on each page. I have an unbound field NUMBER which needs to change depending on what is shown in TRADE. (The field NUMBER will take a value from another field)
I guessed at the statement below:
SWITCH ([TRADE]="1",[NUMBER]=[ELECJOBNUMBER], [TRADE]="2",[NUMBER]=[JOINJOBNUMBER], [TRADE]="3",[NUMBER]=[PAINTJOBNUMBER] etc etc
My syntax doesn't work when I place this code in the On Format event of the report. Should I be placing it in the NUMBER field itself.
I've previously used IIF statements sucessfully but this time I have too many potential values and it was getting messy.
Just need some help with the syntax and placing of this SWITCH statement.
I guessed at the statement below:
SWITCH ([TRADE]="1",[NUMBER]=[ELECJOBNUMBER], [TRADE]="2",[NUMBER]=[JOINJOBNUMBER], [TRADE]="3",[NUMBER]=[PAINTJOBNUMBER] etc etc
My syntax doesn't work when I place this code in the On Format event of the report. Should I be placing it in the NUMBER field itself.
I've previously used IIF statements sucessfully but this time I have too many potential values and it was getting messy.
Just need some help with the syntax and placing of this SWITCH statement.