Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2019 IIF + Public Function 1

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
0
0
GB
Good afternoon, I use Public Function,
Source: fSource ([dbo_tblMAIN_REFERRALS]![N2_16_OP_REFERRAL])

and I also use aliases,

Site: IIf([N2_12_CANCER_TYPE]="16","Breast Symptomatic",[L_CANCER_SITE])

What I'd like to be able to do is to combine the two,

Type: IIf([N2_12_CANCER_TYPE]="16","Screening"', fSource(
[dbo_tblMAIN_REFERRALS]![N2_16_OP_REFERRAL]))

Am I just being too ambitious, or is it just basic stupidity?? [bigsmile]

Many thanks,
D€$
 
Does [tt]N2_12_CANCER_TYPE] = "16"[/tt] result in [tt]"Breast Symptomatic"[/tt] or [tt]"Screening"[/tt]?
Just wondering... [ponder]


---- Andy

There is a great need for a sarcasm font.
 
Hi dhookom, I get the error message "The expression you entered has an invalid string. A string can be up to 2048 characters long, including opening and closing quotation marks."

Hi Andrzejek, well both in a way as it depends on what I'm trying to find out because referrals that are coded "16" come from the Breast Symptomatic Screening programme, and it depends on the context - whether I want to determine if the Cancer Site is "Breast", as they all are stored on the database as "Breast" (!) or "Breast Symptomatic" or whether I'm trying to determine the Source of the referral, e.g. "General Practitioner" or the Screening Service. So "16" will serve to inform each of those outputs.

Many thanks,
D€$
 
Did you really mean to include this single quote:
[tt]IIf([N2_12_CANCER_TYPE]="16","Screening"', fSource(
[dbo_tblMAIN_REFERRALS]![N2_16_OP_REFERRAL]))[/tt]
 
Well I'll be... I almost spotted that as I thought it looked a bit odd on my screen but I, foolishly, didn't peer closer!!

Works the way that I had hoped it would!!

Many thanks,
D€$
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top