Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to count the number of records

Status
Not open for further replies.

susu

Technical User
May 15, 2001
5
US
Hi,
How do i get to show the number of records in a label or text box from a table selected in a combo box?
Thanks
 
Try this in a Form_Load

Dim rs As DAO.Recordset
Dim SQL As String
SQL = "SELECT count(table1.test) as TestCount FROM table1"
Set rs = CurrentDb().OpenRecordset(SQL)
Me.txtTest = rs("TestCount")
rs.Close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top