I don't have Acc2010, but have mocked up your request in Acc2003.
I used your fields Project and AdviceGiven to create a table called MarcAdviceGiven
Below is the code to separate the AdviceGiven field into individual comma separated strings, and
to write these individual strings into a new table TempTableForQuery
Code:
'---------------------------------------------------------------------------------------
' Procedure : SplitAdviceGiven
' Author : Jack
' Date : 10/05/2012
' Purpose : Sample code to parse a column into discrete strings separated at comma.
'This uses the Split function and creates a Temporary Table to be used for queries.
'see https://www.accessforums.net/showthread.php/24677-Separating-information-in-a-table
'
'The incoming records (created in table "MarcAdviceGiven") have field layout
' id auto
' project string
' advicegiven string (multi strings separated by comma)
'
'The output table ("TempTableForQuery") has layout
' id auto
' project string
' advicestring (individual strings extracted from incoming advicegiven)
'
'---------------------------------------------------------------------------------------
'
Sub SplitAdviceGiven()
Dim rs As DAO.Recordset 'incoming records
Dim rsTemp As DAO.Recordset 'temp table for use with query
Dim db As DAO.Database
Dim arrHold() As String
Dim i As Integer
On Error GoTo SplitAdviceGiven_Error
Set db = CurrentDb
Set rs = db.OpenRecordset("MarcAdviceGiven")
Set rsTemp = db.OpenRecordset("TempTableForQuery")
Do While Not rs.EOF
arrHold() = Split(rs!adviceGiven, ",")
For i = LBound(arrHold) To UBound(arrHold)
'Print the project and the individual advice string to immediate window
Debug.Print rs!Project & " - " & Trim(arrHold(i))
'Output project and adviceString to the tempTableforQuery
rsTemp.AddNew
rsTemp!Project = rs!Project
rsTemp!AdviceString = Trim(arrHold(i))
rsTemp.Update
Next i
rs.MoveNext
Loop
rs.Close
rsTemp.Close
On Error GoTo 0
Exit Sub
SplitAdviceGiven_Error:
MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure SplitAdviceGiven of Module AWF_Related"
End Sub
Note I used only a few records from your sample to create test data.
Here is my test data:
Project,AdviceGiven
"MLF000056","Developing your application, Writing business plans,Contingency Planning"
"SLF000112","Developing your application, Marketing and Publicity, Community Involvement"
"MLF000108","Developing your application, Human Resource Management, Community Involvement"
"MLF000134","Writing business plans, Monitoring and Evaluation, Governance Issues"
Once the Temporary table is created you can run a query based on the following:
Code:
SELECT TempTableForQuery.AdviceString, Count(TempTableForQuery.AdviceString) AS CountOfAdviceString
FROM TempTableForQuery
GROUP BY TempTableForQuery.AdviceString;
The contents of the TempTableForQuery is shown in AdviceGivenOutput.jpg.
The output of the query is shown in AdviceGivenQueryResults.jpg.
You will have to adjust names as per your Tables and needs.
The purpose was to show a sample of how to separate the strings and create a query to do counts.