I have a form which my users must input at least 1 date but up to 6 dates into 6 text boxes. I have created an array \"Dim BDate(1 To 6) As String\" in Access. I use a loop to take the dates and place them into the array from the textboxes and sort them from oldest to earliest.
My problem is that Access assigns 0.0 to any field that is left blank and then converts it to 12/1899. It then places that as my first date however many times I have a blank text box and then prints them on my report. Here is the loop I am using. If anyone can help me it would be greatly appreciated. 🙂
BDOne = UBound(BDate)
While BDOne >= LBound(BDate)
For BDTwo = LBound(BDate) To BDOne - 1
If BDate(BDTwo) > BDate(BDTwo + 1) Then
BDateTemp = BDate(BDTwo)
BDate(BDTwo) = BDate(BDTwo + 1)
BDate(BDTwo + 1) = BDateTemp
End If
Next BDTwo
BDOne = BDOne - 1
Wend