Following is the querry:
SELECT DISTINCT [tblTransmittalTracking].[Date] AS
SendTo_BOE_Date, RecordCount("Select CorrectionsID From
tblTransmittalTracking Where [Sent/Received] Like 'Sent
To' AND Division Like 'BOE-Mapping' AND Date Like #" &
SendTo_BOE_Date & "#") AS NoCorrectionsIDsSent,
ConcatCorrIDErrorID("Select CorrectionsID From
tblTransmittalTracking Where [Sent/Received] Like 'Sent
To' AND Division Like 'BOE-Mapping' AND Date Like #" &
SendTo_BOE_Date & "#") AS CorrectionsIDsSent
FROM tblTransmittalTracking
WHERE ((([tblTransmittalTracking].[Sent/Received])
Like 'Sent To') And (([tblTransmittalTracking].
[Division]) Like 'BOE-Mapping'))
ORDER BY [tblTransmittalTracking].[Date];
------------------------
Following is the function:
Function ConcatCorrIDErrorID(pstrSQL As String, Optional
pstrDelim As String = ", ") As String
'MsgBox (pstrSQL)
Dim rs As New ADODB.Recordset
rs.Open pstrSQL, CurrentProject.Connection,
adOpenKeyset, adLockOptimistic
Dim strConcat As String 'build return string
With rs
If Not rs.EOF Then
rs.MoveFirst
Do While Not rs.EOF
strConcat = strConcat & "CorrID:" &
rs.Fields(0)
Dim rs_ErrorID As New ADODB.Recordset
Dim strSQL_ErrorID As String
strSQL_ErrorID = "Select Error_ID From
tblCorrectionsInventory Where CorrectionsID=" & rs.Fields
(0)
'MsgBox (strSQL_ErrorID)
rs_ErrorID.Open strSQL_ErrorID,
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs_ErrorID.MoveFirst
strConcat = strConcat & "--ErrorID:" &
rs_ErrorID.Fields(0) & pstrDelim
rs_ErrorID.Close
Set rs_ErrorID = Nothing
rs.MoveNext
MsgBox (strConcat)
Loop
End If
rs.Close
End With
Set rs = Nothing
If Len(strConcat) > 0 Then
strConcat = Left(strConcat, Len(strConcat) - Len
(pstrDelim))
End If
ConcatCorrIDErrorID = strConcat
End Function
Please help.
Mario
>-----Original Message-----
>"Mario" <(E-Mail Removed)> wrote in
message
>news:1846101c44a57$353d3370$(E-Mail Removed)
>> Is there a data type which is like string of infinite
>> length.
>>
>> What I am trying to do is pass a parameter into a
>> function. This function querries some 5 diff table
based
>> on the parameter and concatenates and returns the
result
>> (to a querry).
>>
>> Any suggestions or examples. Pls help
>
>I'm not sure, but I suspect your problem may be in the
way your function
>expression is being interpreted by the query. Would you
mind posting
>the code of the function and the SQL of the query that
calls it?
>
>--
>Dirk Goldgar, MS Access MVP
>www.datagnostics.com
>
>(please reply to the newsgroup)
>
>
>.
>