Hello All:
I'm sending a value from a query to the following function. The function is running properly based on checking it with breakpoints. However, the result does not show in my string (even though it is in the variable at the end).
Thanks,
Tony
Function GetSchoolsList(RefID As Integer) As Variant
Dim SchoolList As String
Dim rs As Recordset
Dim r As Integer
r = RefID
Set rs = CurrentDb.OpenRecordset("SELECT from qryUnavailSchoolsANDReferees WHERE [RefID] = " & r & " AND [Sportid] = 'FB';")
With rs
Do Until .EOF
SchoolList = SchoolList & ! & ","
.MoveNext
Loop
.Close
End With
SchoolList = Left(SchoolList, Len(SchoolList) - 1)
GetSchoolList = SchoolList
Set rs = Nothing
End Function
I'm sending a value from a query to the following function. The function is running properly based on checking it with breakpoints. However, the result does not show in my string (even though it is in the variable at the end).
Thanks,
Tony
Function GetSchoolsList(RefID As Integer) As Variant
Dim SchoolList As String
Dim rs As Recordset
Dim r As Integer
r = RefID
Set rs = CurrentDb.OpenRecordset("SELECT
With rs
Do Until .EOF
SchoolList = SchoolList & !
.MoveNext
Loop
.Close
End With
SchoolList = Left(SchoolList, Len(SchoolList) - 1)
GetSchoolList = SchoolList
Set rs = Nothing
End Function