- Joined
- Jun 28, 2011
- Messages
- 1
- Reaction score
- 0
Hello everyone!
I have a MS Access DB and created a Concatenate module named 'modConcatenate'
Everytime I open the DB though I recieve the error msg:
Undefined function 'concatenate' in expression
Here is my code for the module/function:
Function Concatenate(pstrSQL As String, _
Optional pstrDelim As String = ", ") _
As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(pstrSQL)
Dim strConcat As String 'build return string
With rs
If Not .EOF Then
.MoveFirst
Do While Not .EOF
strConcat = strConcat & _
.Fields(0) & pstrDelim
.MoveNext
Loop
End If
.Close
End With
Set rs = Nothing
If Len(strConcat) > 0 Then
strConcat = Left(strConcat, _
Len(strConcat) - Len(pstrDelim))
End If
Concatenate = strConcat
End Function
Any ideas why I am receiving this error message?
I have a MS Access DB and created a Concatenate module named 'modConcatenate'
Everytime I open the DB though I recieve the error msg:
Undefined function 'concatenate' in expression
Here is my code for the module/function:
Function Concatenate(pstrSQL As String, _
Optional pstrDelim As String = ", ") _
As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(pstrSQL)
Dim strConcat As String 'build return string
With rs
If Not .EOF Then
.MoveFirst
Do While Not .EOF
strConcat = strConcat & _
.Fields(0) & pstrDelim
.MoveNext
Loop
End If
.Close
End With
Set rs = Nothing
If Len(strConcat) > 0 Then
strConcat = Left(strConcat, _
Len(strConcat) - Len(pstrDelim))
End If
Concatenate = strConcat
End Function
Any ideas why I am receiving this error message?