Hello,
I am a student working on a project for class. We have an Access database that we are building and I have run into a problem with some of the reports we need to generate. Some of the report values have to be produced into sentence format on the report. Below I will try to explain the problem.
I have a report that is producing multiple clients, multiple medications per client and multiple dosages and times of delivery per medication. Just producing these items in a blocked format works fine. Displaying with a hierarchy of:
Code:
client medication dose time
John Doe
med 1 1 tab 12:00AM
2 tab 1:00PM
med 2 1 tab 12:00AM
2 tab 3:00PM
Susie Q
med1 1 tab 12:00PM
med2 2 tab 3:00PM
3 tab 9:00PM
What needs to be produced is this information in the format below:
Code:
Client medication
John Doe
med 1, 1 tab @ 12:00AM AND 2 tab @ 1:00PM 'Name reproducing values from one textbox
med 2, 1 tab @ 12:00AM AND 2 tab @ 3:00PM 'Time reproducing values from one textbox
Susie Q 'Dose reproducing values from one textbox
med 1, 1 tab @ 12:00PM
med 2, 2 tab @ 3:00PM @ 3 tab @ 9:00PM
I have reviewed the concatenation example online about concatrelated() and tried to use that solution in a module. It would loop through the fields dose and time and produce the values in a concatenated string. I think that solution was only meant to be displayed once as it gave me the answer I was looking for but did not repeat on the report in the appropriate text boxes per client, per medication. I later realized that I would need to also loop through the client names since they were repeating. So my understanding is that I need to loop through the client names, loop through the dose and time values and set the medication text box to: =[medication name] ", " & FunctionforDose() "@ " & FunctionforTime(). I would need to pull the value from the name text box so that the function knows where it needs to look to pull the correct information, but it also has to use a function to reproduce the repeating value of the names on the report. I have color coded examples of my understanding of the problem points here. Am I over complicating this process? Is there an easier way of doing this operation? Any help would be greatly appreciated. I will provide any clarification needed.
Thanks in advance,
Jared