I am trying to create an export using a query that pulls "Event" and "Event Details." I have a one to many relationship from tblEvent to tblEventDetails. My export should show one record for each event, with a string field containing the event details. I'm trying to create a function that pulls one field for the "Event Details" as a string.
Here's what I've tried so far:
Any help would be greatly appreciated! I've been struggling with this one...
Here's what I've tried so far:
Code:
Public Function Operations As String
Dim cnCurrent as ADODB.Connection
Dim rsQuery1 as ADODB.Recordset
Dim strSQL As string, strTypes as String
strSQL="SELECT Type FROM Table1 WHERE (((IDNumber=" & PersonID & "));"
strTypes = ""
Set cnCurrent = CurrentProject.Connection
Set rsQuery1 = New ADODB.Recordset
With rsQuery1
If .RecordCount>0 Then
.MoveFirst
Do Until .EOF
If strTypes = " " Then
strTypes = !Type
Else
strTypes = strTypes & !Type
End If
.Movenext
Loop
Operations = strTypes
Else
Operations = ""
End If
End With
rsQuery1.Close
cnCurrent.Close
End Function
Any help would be greatly appreciated! I've been struggling with this one...