Find Field Name not field value

CanadianAccessUser

Registered User.
Local time
, 22:01
Joined
Feb 7, 2014
Messages
114
Hello,

I'm trying to convince Access to find a value and then convert said value into the name of the field it came from.

Below is my current code:
Code:
LowestMark: 
Minimum([AvgOfOpening1],[AvgOfConfidentiality1],[AvgOfEmail1],[AvgOfTenureStatement1],[AvgOfOwnership1],[AvgOfClearExplanation],[AvgOfProbing1],[AvgOfUseofTools1],[AvgOfResolveBeforeS2S1],[AvgOfBridgeSolutions],[AvgOfSummarizeWrapUp1],[AvgOfOfferFurtherAssistance1],[AvgOfOneFaceOneVoice1],[AvgOfAppreciateBrandCox1],[AvgOfInteractwithCustomer1])
(Minimum is from a module that finds the lowest value in the list.)

I need my query to tell me which field gives that value.
Example:
Agent Name AvgOfEmail1
instead of:
Agent Name 41.7%

Does anyone know how to make this work?

Thanks
 
Do you have lookups at the table field level?
Please show us a jpg of the tables and relationships involved.
 
It all comes from one table that stores all the marks on the test. The only relationship is to the agents table.
My table for the data I'm using has lookups.
One lookup looks at another table for the agent's name
The rest are for the marks on each question in the test: Value List "1";"0"
 
Last edited:
Please show us a jpg of the tables and relationships involved.

And show us the SQL of your query.
 
Code:
SELECT qryLowestElement.NameUsed, qryLowestElement.Coach, Minimum([AvgOfOpening1],[AvgOfConfidentiality1],[AvgOfEmail1],[AvgOfTenureStatement1],[AvgOfOwnership1],[AvgOfClearExplanation],[AvgOfProbing1],[AvgOfUseofTools1],[AvgOfResolveBeforeS2S1],[AvgOfBridgeSolutions],[AvgOfSummarizeWrapUp1],[AvgOfOfferFurtherAssistance1],[AvgOfOneFaceOneVoice1],[AvgOfAppreciateBrandCox1],[AvgOfInteractwithCustomer1]) AS LowestMark, IIf([LowestMark]=[AvgOfOpening1],"Opening",IIf([LowestMark]=[AvgOfConfidentiality1],"Confidentiality",IIf([LowestMark]=[AvgOfEmail1],"Email",IIf([LowestMark]=[AvgOfTenureStatement1],"Tenure Statement",IIf([LowestMark]=[AvgOfOwnership1],"Ownership",IIf([LowestMark]=[AvgOfClearExplanation],"Clear Explanation",IIf([LowestMark]=[AvgOfProbing1],"Probing",IIf([LowestMark]=[AvgOfUseofTools1],"Use of Tools",IIf([LowestMark]=[AvgOfResolveBeforeS2S1],"Resolve Issue before S2S",IIf([LowestMark]=[AvgOfBridgeSolutions],"Bridge and Present Solutions",IIf([LowestMark]=[AvgOfSummarizeWrapUp1],"Summarize and wrap up",IIf([LowestMark]=[AvgOfOfferFurtherAssistance1],"Offer Further Assistance",IIf([LowestMark]=[AvgOfOneFaceOneVoice1],"One Face One Voice",IIf([LowestMark]=[AvgOfAppreciateBrandCox1],"Brand Cox","Interact with Customer")))))))))))))) AS LowestElement, qryLowestElement.AvgOfOpening1, qryLowestElement.AvgOfConfidentiality1, qryLowestElement.AvgOfEmail1, qryLowestElement.AvgOfTenureStatement1, qryLowestElement.AvgOfOwnership1, qryLowestElement.AvgOfClearExplanation, qryLowestElement.AvgOfProbing1, qryLowestElement.AvgOfUseofTools1, qryLowestElement.AvgOfResolveBeforeS2S1, qryLowestElement.AvgOfBridgeSolutions, qryLowestElement.AvgOfSummarizeWrapUp1, qryLowestElement.AvgOfOfferFurtherAssistance1, qryLowestElement.AvgOfOneFaceOneVoice1, qryLowestElement.AvgOfAppreciateBrandCox1, qryLowestElement.AvgOfInteractwithCustomer1
FROM qryLowestElement;
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    75.5 KB · Views: 50
A couple of points:

When you post a jpg of your tables and relationships, it helps readers if you expand the tables to show all fields.

When you are working with queries that aren't working as expected, or you really are unsure of how to set it up, start with a simple query and get it working so that you understand the syntax involved. Then start adding some of the complexity and get it working. Proceed iteratively until you get your final query.
 
Sorry about that...

I have some queries doing some work for me between the table and the query I'm working on. The queries do things like find the average percentage that each agent is receiving on the test sections.

I've attached a new relationship jpg. The tables are expanded so you can see them, but the relationship isn't showing. I have a one to many relationship between tblAgents and tblQualityForm.

Anything else I can give you to help you see what it is I'm doing wrong? lol

Is there a code I'm missing that can tell the expression to return the field name instead of the value?
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    89.9 KB · Views: 43
Last edited:

Users who are viewing this thread

Back
Top Bottom