Store it where?
Here is an example of ONE way to add the data to a table:
Code:
' Dim CountItem as Integer
' Dim MeasureType as Integer
Dim sSQL As String
Dim rs as DAO.Recordset
Dim rt as DAO.Recordset
Set rs = CurrentDb.OpenRecordset ("[queryName]") 'source data
Set rt = CurrentDb.OpenRecordset ("Metrics") 'target table name
If Not rs.EOF Then
rs.MoveFirst
While rs.EOF = false
rt.Add
rt!CountItem = rs.CountOfItem_ID
rt!MeasureType = rs.MeasurementType_ID
rt.Update
' CountItem = (this is where I get stuck, because I can't figure out how to get that info from the field)
' MeasureType =
rs.MoveNext
Wend
End If
'Clean up
rs.Close
rt.Close
Set rs = Nothing
Set rt = Nothing
Another method is to create (in code) a SQL append query.