How to perform date formatting in the listview item text property? It is currently displaying #2011/08/08# and I want to convert it to "mm-dd-yyyy".
Please help!
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 14, 2011, 6:58 AM
However, if you're using databinding, it might be easier to format the date before binding takes place.
VulpesPosted Sep 14, 2011, 11:02 AM
latika singhPosted Sep 14, 2011, 10:51 AM
to strTempArray(7) = translate("CYCLE TIME: ") & Me.ConvertDateTime(stDate, eDate)
Says, expression does not produce a value.
VulpesPosted Sep 14, 2011, 10:13 AM
latika singhPosted Sep 14, 2011, 9:30 AM
stDate = CDate(ListView1.Items(0).Text).ToShortDateString
eDate = CDate(ListView1.Items(ListView1.Items.Count - 1).Text).ToShortDateString
End Sub
The two variables above, I want to pass them to another sub inside line:
strTempArray(7) = translate("CYCLE TIME: ") & stDate.ToShortDateString & " -- " & eDate.ToShortDateString
Currently I am ignoring the ConvertDateTime() and declaring the above variables locally in another sub to store in the strTempArray(7) variable.
Is it possible to do it by creating a subroutine that separately stores Listview item string and then pass these variables the way it is now in the temp array variable?
VulpesPosted Sep 14, 2011, 9:06 AM
You can then print the array with code such as this:
latika singhPosted Sep 14, 2011, 8:28 AM
But now i need to use these variables stDate and eDate into another sub to print Cycle Time. Check the line below:
TempArray() = translate ("Cycle Time") & stDate.ToshortDateString & eDate.ToShortDateString.
This line is in another sub. I need to pass the above two variables in this line.