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!

Counting records in query 1

Status
Not open for further replies.

paulminne

Programmer
Nov 27, 2002
80
AU
Hi,

I need to be able to simply count the number of records within a query from the click event of a button on a form, and then display the results of the count into a text box (on the same form). However am struggling to do so...

I know there must be a simple solution, but I cannot for the life of me find it..

Regards,

- Paul
 
In the click event you could put something like this.
Dim myCount as Long
myCount = DCount("FieldName","TableName")
Me.TextboxName = myCount

Paul
 
I have the same needs except my query is an update query and apparently it is much trickier to get the record count of an action query w/o actually running the query.

Anyone know how to do this?
 
You could use two queries. A regular select to get the count from and then base you Update query on the Select query.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top