I fould the below code demonstaring how to output multivalue fields;
Sub BrowseMultiValueField()
Dim db As Database
Dim rs As Recordset
Dim childRS As Recordset
Set db = CurrentDb()
' Open a Recordset for the Task Table
Set rs = db.OpenRecordset("Tasks")
rs.MoveFirst
Do Until rs.EOF
'Print the name of the task to the immediate window
Debug.Print rs!TaskName.Value
'Open a Recordset for the multivalue field
Set childRS = rs!AssignedTo.Value
'Exit the loop if the multivalue field contains no records
Do Until childRS.EOF
childRS.MoveFirst
'Loop through the records in the child recordset
Do Until childRS.EOF
'Print the owner(s) of the Task to the immediate window
Debug.Print Chr(0), childRS!Value.Value
childRS.MoveNext
Loop
Loop
rs.MoveNext
Loop
End Sub
The output of this code is as follows:
Issue1
5
6
Issue2
6
7
Issue3
5
6
7
The numerics are the ID (bound column) field. Can I get the next field over
from the ID (sort of an OFFSET) 5 = Jim; 6 = Bill; 7 = Dick?
Relatively new to access here!!!
|