Inserting an Unbound Textbox to Count Records

T

TomP

Hello:

I have a form that is attached to a query. I disabled the navigation status
bar and and disabled the allow edits and deletions to the form. What I would
like to add is a textbox that will actually give the total record count on
the form.

I researched your discussion group questions and tried some coding and still
couldn't make it work. Is there a way to enter a simple formula in the
"Default Value" to get a total record count of records in query that is
attached to the form?

Thank you,
 
J

Jeff Boyce

You don't mention what you tried ("tried some coding").

Rather than use the Default Value to calculate an initial value for the
record (which, by the way, when new, would have NO values in the other
fields, so would evaluate to zero or null or some such!), consider putting a
formula/expression in the AfterUpdate event of each/every control in which
the user could add/edit a value. The expression tells Access how to
calculate the new value and tells it where to stick it...


Regards

Jeff Boyce
Microsoft Office/Access MVP
 
T

TomP

With the navigation buttons set to "No", I want the form to display a total
record count value which will retrieve and count all records. My record
source data is based on a query.

I did tried the =Count(*) at the form footer and got only a zero.

Thank you,
 
T

TomP

This form does have 260 records. I created this form so the user can only
"view" the records only. Without have the navigation button visible would
only help enforce the policy.

Your suggestion to add the code in the Load event procedure works! The only
draw back is that the data will only appear when I click the field.

This might be asking too much, but is there a way to have the total record
account appear automatically? If not, I can create a textbox to say "click
here" or something.

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top