N
nouveauricheinvestments
Hi,
I have the following function which I am using to create a string of a
series of values in my table.
Function Concatenate(pstrSQL As String, Optional pstrDelim As String)
As String
Dim Rs As ADODB.Recordset
Set Rs = New ADODB.Recordset
Rs.Open pstrSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Dim strConcat As 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
My control record source on my form is the following:
=Concatenate("SELECT Order_Details.TicketNumber FROM Order_Details
WHERE Order_Details.PTID = " & [Description])
Whenever I try to load the form, I get the following runtime error:
No value given for one or more required parameters
Any idea what I'm doing wrong?
I have the following function which I am using to create a string of a
series of values in my table.
Function Concatenate(pstrSQL As String, Optional pstrDelim As String)
As String
Dim Rs As ADODB.Recordset
Set Rs = New ADODB.Recordset
Rs.Open pstrSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Dim strConcat As 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
My control record source on my form is the following:
=Concatenate("SELECT Order_Details.TicketNumber FROM Order_Details
WHERE Order_Details.PTID = " & [Description])
Whenever I try to load the form, I get the following runtime error:
No value given for one or more required parameters
Any idea what I'm doing wrong?