Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

[RESOLVED] how to count the table records and display the total in a textbox

$
0
0
i am trying to count the total customers in the table and display the total in a text box but i get
item not found in the collection why?
this is my code
Code:

Private Sub Form_Load()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
'Set rs = CN.excute("SELECT Count(Customers.ID) AS CountOfID FROM Customers Order By Customers.ID")
rs.Open "SELECT Count(Customers.FullName) AS CountOfFullName FROM Customers", CN, adOpenStatic, adLockOptimistic
While Not rs.EOF


        TxtCust.text = rs!FullName' here is the error

 rs.MoveNext
    Wend

rs.Close

tnx for the help

Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>