これが潜在的な解決策です。
ステップ1:
MS Access アプリでこの関数を作成します。これが最も効率的なソリューションだとは思いませんが、レコード数がそれほど多くない場合は十分に機能するはずです。
Public Function getErrorText(ByVal MyId As Double) As String
Dim myrs As Recordset
'Create the recordset
Set myrs = CurrentDb.OpenRecordset("select distinct ErrorID from tblError where RequestID = " & MyId)
'Build the error string
Do Until myrs.EOF
getErrorText = myrs.Fields(0).Value & ", " & getErrorText
myrs.MoveNext
Loop
'Clean up
myrs.Close
Set myrs = Nothing
'Return the correct cleaned up string
getErrorText = Left(getErrorText, Len(getErrorText) - 2)
End Function
ステップ2:
その後、次の SQL ステートメントを実行して、目的の出力を取得できるはずです。
SELECT distinct tblError.RequestID, getErrorText( tblError.[RequestID]) AS [Error(s)]
FROM tblError INNER JOIN tblRequest ON tblError.RequestID = tblRequest.RequestID
WHERE (((getErrorText( tblError.[RequestID])) Is Not Null));