I have a textbox that should be generated from a set of dates in a subform. This function returns #size! error in the textbox. Hoping someone can help me decipher what the problem is.
Code:
Public Function DatesToTextBox() As String 'returns string value of dates in recordset, comma separated, formatted 'm/d'
Dim v As Variant
Dim s As String
'
'
'
With Me!subfrmIODates.Form.RecordsetClone
If Not (.BOF And .EOF) Then .MoveFirst
While Not .EOF
v = .Fields("Air_Date").value
If Not IsNull(v) Then
v = Split(v, " ")(1)
v = CDate(v)
s = s & Format(v, "m\/d") & ", "
End If
Debug.Print s
.MoveNext
Wend
End With
If Len(s) > 0 Then s = Left(s, Len(s) - 2)
DatesToTextBox = s
End Function
Thanks in advance for your great advice!
MIB1019