Need to show the data from query in a text box with grouping. Attached documents for reference. Please kindly help.
Query Structure provided and Text box format provided.
Need to show the data from query in a text box with grouping. Attached documents for reference. Please kindly help.
Query Structure provided and Text box format provided.
Requires VBA code, review http://allenbrowne.com/func-concat.html
Example in textbox doesn't reconcile with sample records. There is no 250K7 class for 5/11/2018. Nor are the last values (8, 7, 12, 9, 55) in the records.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Please check this:
It was wrong i accept. but please provide a vba to proceed with the below screenshots:
The VBA is in the referenced link. You will have to adapt to your situation.
I did a quick test. This was more difficult than usual for this sort of requirement.
Copy/Paste the code into a VBA module.
Query1:
SELECT Table2.Entry_Date, [Class] & Chr(13) & Chr(10) & ConcatRelated("Batch_No & ',' & Tensile_Strength & ',' & Elongation & ',' & Brinell_HA","Table2","Entry_Date=#" & [Entry_Date] & "# AND Class='" & [Class] & "'","Entry_Date,Class",Chr(13) & Chr(10)) AS T
FROM Table2
GROUP BY Table2.Entry_Date, [Class] & Chr(13) & Chr(10) & ConcatRelated("Batch_No & ',' & Tensile_Strength & ',' & Elongation & ',' & Brinell_HA","Table2","Entry_Date=#" & [Entry_Date] & "# AND Class='" & [Class] & "'","",Chr(13) & Chr(10));
Then Query2:
SELECT Query1.Entry_Date, [Entry_Date] & Chr(13) & Chr(10) & ConcatRelated("T","Query1","Entry_Date=#" & [Entry_Date] & "#","",Chr(13) & Chr(10)) AS TT
FROM Query1
GROUP BY Query1.Entry_Date, [Entry_Date] & Chr(13) & Chr(10) & ConcatRelated("T","Query1","Entry_Date=#" & [Entry_Date] & "#","",Chr(13) & Chr(10));
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Hi
Thanks. Please can you explain the process.
Regards
prithwi
where will i use this module??
You copy/paste Allen's code into a general VBA module. Then build the queries as suggested.
What exactly do you not understand about those instructions?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.