By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

Why can't Listview show data using format dd/mm/yyyy?

P: n/a
Dear all.

I really need help for my code.
im using text box to filter data in listview, heres the code
Expand|Select|Wrap|Line Numbers
  1. reloadlistview1 "select * from sales where TANGGAL  between #" & Text1.Text & "#" & _
  2.                  "and #" & Text2.Text & "# order by noinvoice"
  3.  
and

Expand|Select|Wrap|Line Numbers
  1. Private Sub reloadlistview1(ByVal sqlstr As String)
  2. ListView1.ListItems.Clear
  3.  
  4. rec sqlstr
  5.  
  6. If Not rs.EOF Then
  7. Do Until rs.EOF
  8. Set lv = ListView1.ListItems.Add(, , IIf(IsNull(rs.Fields!TANGGAL) = True, "", Format(rs.Fields!TANGGAL, "dd/mm/yyyy")))
  9. lv.SubItems(1) = IIf(IsNull(rs.Fields!noinvoice) = True, "", rs.Fields!noinvoice)
  10. lv.SubItems(2) = IIf(IsNull(rs.Fields!NAMA) = True, "", rs.Fields!NAMA)
  11. lv.SubItems(3) = IIf(IsNull(rs.Fields!produk) = True, "", rs.Fields!produk)
  12. lv.SubItems(4) = IIf(IsNull(rs.Fields!KODE_BAHAN) = True, "", rs.Fields!KODE_BAHAN)
  13. lv.SubItems(5) = IIf(IsNull(rs.Fields!NAMA_BAHAN) = True, "", rs.Fields!NAMA_BAHAN)
  14. lv.SubItems(6) = IIf(IsNull(rs.Fields!Qty) = True, "", rs.Fields!Qty)
  15. lv.SubItems(7) = IIf(IsNull(rs.Fields!Harga) = True, "", rs.Fields!Harga)
  16. lv.SubItems(8) = IIf(IsNull(rs.Fields!sales) = True, "", rs.Fields!sales)
  17. lv.SubItems(9) = IIf(IsNull(rs.Fields!TGL_DP) = True, "", rs.Fields!TGL_DP)
  18. lv.SubItems(10) = IIf(IsNull(rs.Fields!DP) = True, "", rs.Fields!DP)
  19. lv.SubItems(11) = IIf(IsNull(rs.Fields!PIUTANG) = True, "", rs.Fields!PIUTANG)
  20. lv.SubItems(12) = IIf(IsNull(rs.Fields!SELESAI) = True, "", rs.Fields!SELESAI)
  21.  
  22. rs.MoveNext
  23. Loop
  24. End If
  25. End Sub
  26.  
  27.  
when i input the textbox1 & textbox 2 with format dd/mm/yyyy, the result in listview is blank, but if i input with format mm/dd/yyyy its work correctly.

is there any code should i change?
for your info im using Access 03 with field using format short date , with regional option : Indonesian

thank you
Nov 4 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.