Results 1 to 3 of 3

Thread: [RESOLVED] Something mess in this coding...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Resolved [RESOLVED] Something mess in this coding...

    Could somebody help me to get out of this problem. The code for lvwSales working fine..while the same code is not working for lvwCollections (I can see nothing in the lvwCollections after the querry is executed for searching Date).

    VB Code:
    1. Private Sub cmdSearchDate_Click()
    2. Set rs = New ADODB.RecordSet
    3.  
    4. Dim FD, TD
    5. FD = CDate(txtFromDate.Text)
    6. TD = CDate(txtToDate.Text)
    7.  
    8. strSQL = "Select CustomerName, InvoiceNumber, InvoiceDate, InvoiceAmount, FileNumber from Sales where invoicedate between #" & Format(FD, "yyyy/mm/dd") & "# and #" & Format(TD, "yyyy/mm/dd") & "#"
    9. rs.Open strSQL, db, adOpenDynamic, adLockOptimistic
    10.  
    11. If rs.RecordCount <> 0 Then
    12.  Call FillListView(lvwSales, rs)
    13.  Else
    14.   lvwSales.ListItems.Clear
    15. End If
    16.  
    17. rs.Close
    18.     Set rs = Nothing
    19.    
    20. Set rs = New ADODB.RecordSet
    21.  
    22. Dim FFD, TTD
    23. FFD = CDate(txtFromDate.Text)
    24. TTD = CDate(txtToDate.Text)
    25.  
    26. strSQL = "Select CustomerName, DepositDate, DepositedIn, AmountReceived, FileNumber from Collections where DepositDate between #" & Format(FFD, "yyyy/mm/dd") & "# and #" & Format(TTD, "yyyy/mm/dd") & "#"
    27. rs.Open strSQL, db, adOpenDynamic, adLockOptimistic
    28.  
    29. If rs.RecordCount <> 0 Then
    30.  Call FillListView(lvwCollections, rs)
    31.  Else
    32.   lvwCollections.ListItems.Clear
    33. End If
    34.  
    35. rs.Close
    36.     Set rs = Nothing
    37.    
    38. End Sub
    Seema_s

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Something mess in this coding...

    The first, and most basic question is are you sure you have data in the collections table that fits that date criteria?

    What database are you using?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Re: Something mess in this coding...

    Quote Originally Posted by Hack
    The first, and most basic question is are you sure you have data in the collections table that fits that date criteria?

    What database are you using?
    Yes. It works fine if I use search either for lvwSales or lvwCollections. But it doesnt work both at a time with search.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width