Information from a query

P

PJ

I have the expression in my query and I only want the query to return the
first name from the expression. It will sometime return a specific name
twice. How would I just return the a specific name once even if that specific
name was in "Capital Markets originator" and " Capital Markets Distributor"?
Thanks in advance

Capital Markets Name: (IIf([Capital Markets
originator]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
originator]) & IIf([Capital Markets
Derivatives]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Derivatives]) & IIf([Capital Markets
Distributor]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Distributor]) & IIf([Capital Markets Jr
Support]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets Jr
Support]) & IIf([Capital Markets
Referral]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Referral]) & IIf([Capital Markets Backstop
Originator]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Backstop Originator]) & IIf([Capital Markets Backstop
Trader]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets Backstop
Trader]) & IIf([Capital Markets Referral
Secondary]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Referral Secondary]))
 
T

Tom Ellison

Capital Markets Name:
(IIf([Capital Markets originator] =
[forms]![frmRCM]![txtEntertheMarketerName], [Capital Markets originator])
& IIf([Capital Markets Derivatives] =
[forms]![frmRCM]![txtEntertheMarketerName], [Capital Markets Derivatives])
& IIf([Capital Markets Distributor] =
[forms]![frmRCM]![txtEntertheMarketerName], [Capital Markets Distributor])
& IIf([Capital Markets Jr Support] =
[forms]![frmRCM]![txtEntertheMarketerName], [Capital Markets Jr Support])
& IIf([Capital Markets Referral] =
[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets Referral])
& IIf([Capital Markets Backstop Originator] =
[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets Backstop
Originator])
& IIf([Capital Markets Backstop Trader] =
[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets Backstop
Trader])
& IIf([Capital Markets Referral Secondary] =
[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets Referral
Secondary]))

Now, this will return what is in txtEntertheMarketerName whenever it matches
any of the 8 columns, right? What do you want it to return with it doesn't
match any of them?

I would start with:

Capital Markets Name:
IIf([forms]![frmRCM]![txtEntertheMarketerName] IN (
[Capital Markets originator], [Capital Markets Derivatives],
[Capital Markets Distributor], [Capital Markets Jr Support],
[Capital Markets Referral], [Capital Markets Backstop Originator],
[Capital Markets Backstop Trader], [Capital Markets Referral Secondary]),
[forms]![frmRCM]![txtEntertheMarketerName], "whatever else")

Where I have put "whatever else" you can put what you want when it is none
of these 8 things.

If I understand this correctly, this should be equivalent to what you
posted. If it is always one of the 8 things, then just use:

Capital Markets Name:
[forms]![frmRCM]![txtEntertheMarketerName]

This would simply always return what is in the control.

Did I get anywhere close?

Tom Ellison


PJ said:
I have the expression in my query and I only want the query to return the
first name from the expression. It will sometime return a specific name
twice. How would I just return the a specific name once even if that
specific
name was in "Capital Markets originator" and " Capital Markets
Distributor"?
Thanks in advance

Capital Markets Name: (IIf([Capital Markets
originator]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
originator]) & IIf([Capital Markets
Derivatives]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Derivatives]) & IIf([Capital Markets
Distributor]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Distributor]) & IIf([Capital Markets Jr
Support]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets Jr
Support]) & IIf([Capital Markets
Referral]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Referral]) & IIf([Capital Markets Backstop
Originator]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Backstop Originator]) & IIf([Capital Markets Backstop
Trader]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Backstop
Trader]) & IIf([Capital Markets Referral
Secondary]=[forms]![frmRCM]![txtEntertheMarketerName],[Capital Markets
Referral Secondary]))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top