trying to be brief and simple as possible.
my insurance company provides 5 policies to its clients: a, b, c, d, & e.
my company also works with several different agents.
some agents are associated with more than one policy.
there is a report that I'm trying to build that shows the client name, and below that, the policies provided, and which agent is associated with them.
right now, i've got it doing this:
Client X
PolicyA - Agent1
PolicyB - Agent2
PolicyC - Agent1
but what I really want on the report in this scenario is:
ClientX
PolicyA,C - Agent1
PolicyB - Agent2
in order to save space and for the report reader's simplicity.
I've tackled this by:
1. setting up several txtbox fields on the report to handle up to 5 different agents per client (although this is unlikely to happen)just in case each policy has a different agent.
2. setting up an array to hold all of the agentID #'s for each policy type
I need to traverse the array and find if the array contains two matching agentID's. If they are all different, then I need to populate 3 of the 5 boxes with the agent name. But if there is a duplicate, then only 2 of the 5 need to be populated. As you can extrapolate, the problem gets more involved the more coverages involved - in this project it will soon be up to 10, so I want to write a clean procedure now that will easily accomodate them.
I am uncertain how to proceed from here and could use some conceptual hints or examples of something similar. Is this even a problem best tackled by loops and arrays (i have a sneaky feeling recursion may be involved here?, but i was always bad at applying that concept, it just seems to short circuit my brain)
I can post my lousy code, which isn't working if need be, but i think my problem is more conceptual in nature.
if you're still reading, thanks.
if you reply - thanks even more!
I am a nobody, and nobody is perfect; therefore, I am perfect.
my insurance company provides 5 policies to its clients: a, b, c, d, & e.
my company also works with several different agents.
some agents are associated with more than one policy.
there is a report that I'm trying to build that shows the client name, and below that, the policies provided, and which agent is associated with them.
right now, i've got it doing this:
Client X
PolicyA - Agent1
PolicyB - Agent2
PolicyC - Agent1
but what I really want on the report in this scenario is:
ClientX
PolicyA,C - Agent1
PolicyB - Agent2
in order to save space and for the report reader's simplicity.
I've tackled this by:
1. setting up several txtbox fields on the report to handle up to 5 different agents per client (although this is unlikely to happen)just in case each policy has a different agent.
2. setting up an array to hold all of the agentID #'s for each policy type
I need to traverse the array and find if the array contains two matching agentID's. If they are all different, then I need to populate 3 of the 5 boxes with the agent name. But if there is a duplicate, then only 2 of the 5 need to be populated. As you can extrapolate, the problem gets more involved the more coverages involved - in this project it will soon be up to 10, so I want to write a clean procedure now that will easily accomodate them.
I am uncertain how to proceed from here and could use some conceptual hints or examples of something similar. Is this even a problem best tackled by loops and arrays (i have a sneaky feeling recursion may be involved here?, but i was always bad at applying that concept, it just seems to short circuit my brain)
I can post my lousy code, which isn't working if need be, but i think my problem is more conceptual in nature.
if you're still reading, thanks.
if you reply - thanks even more!
I am a nobody, and nobody is perfect; therefore, I am perfect.