DateList as separate values.

ajb_1976

Registered User.
Local time
Today, 08:30
Joined
Feb 25, 2005
Messages
34
Hello, I have, with the help of this forum modifed some code that now returns a list of dates in sequence compiled from a start date and repeat count entered by the user.
My problem is this - the output provided the dates as one record, is there any way that these values can be stripped and placed as individual records?
Thanks.


Function x(hStart As Date, repeat As Integer) As String

Dim dteHold As Date
Dim strHold As String
Dim n As Integer

dteHold = hStart
strHold = ""
For n = 1 To repeat

strHold = strHold & dteHold & ", "
dteHold = DateAdd("d", 1, dteHold)

Next n

x = Left(Trim(strHold), Len(Trim(strHold)))

End Function
 
What do you mean, "as one record"? Anyway try this
Code:
Private Sub StringDelimiter(aString as String, aDelimiter as String)
	Dim tempArray as Variant
	Dim i as Integer

	tempArray = Split(aString, aDelimiter, -1)
	For i = 0 to UBound(tempArray)
		'Do whatever you need to do with
		'each i, which is each thing in the string
		'if they're all dates, you might need to:
		' "#" & i & "#" to get the dates to be accepted
		'(otherwise, Access will view them as strings)
	Next i
End Sub
 

Users who are viewing this thread

Back
Top Bottom