TextBox to show number of records in a table?

robjones23

Registered User.
Local time
Today, 18:09
Joined
Dec 16, 2004
Messages
66
I'm sure this should be simple but I can't figure it out. What I want is for a text box on a form to display the number of records within a table.

Basically I've got a make table query which creates a table ox X records depending on how many records in the original table match the criteria. So for example:

Table A has 100 records

Query identifies 30 that mee the criteria

Makes a new table called criteria_met with these 30 records

What I want is for a textbox on a form to display "30" and update whenever the make table query runs (probably via a macro??)
 
You would need to create a list box to display the information, within the properties select query that you create.

Depending on how you run the make table query then you could use this way of updating the value in the list box.

If you run it through a simple command button then just add the following code to the on_click procedure

list_box..Requery

I hope this help, let me know if you get stuck
 
Add a textbox to your form. Set the control source of the textbox to
=DCount("[PK]","YourtblName")

or

=DCount("*","YourtblName")

Hope this helps
 

Users who are viewing this thread

Back
Top Bottom