Create a value based on number of records

  • Thread starter Thread starter Jamie Harbour via AccessMonster.com
  • Start date Start date
J

Jamie Harbour via AccessMonster.com

Hello

I have a form which shows a list of staff, does anybody know how i can
calculate how many staff there are and display the number in a text box on
the same form,

Thanks

Jamie
 
Jamie said:
I have a form which shows a list of staff, does anybody know how i can
calculate how many staff there are and display the number in a text box on
the same form,


You can display the number of staff in the form's list by
using a text box with the expression =Count(*) in the
form's Header or footer section.
 
Marshall

The records i want to be counted are in a subform and i want the result
displayed on the main form and saved to a table,

Thanks

Jamie
 
Jamie said:
The records i want to be counted are in a subform and i want the result
displayed on the main form and saved to a table,


Do what I said in the subform, then a main form text box can
display the display the count by referring to the subform
text box:
=subformcontrolname.Form.textboxname

I will argue strongly that this kind of calculated value
should never be stored in a table.

Even if you could come up with a valid reason to save it,
you would have a lot of trouble synchronizing the
calculation with the VBA procedure necessary to save it.
 
There's nothing wrong with displaying a count of the records on the
subform, however saving the information to table is quite anathema(sp)
when it comes to database normalization. Anytime you're dealing
something like this its always better to grab the count of records when
the form, query or report is displayed.
 
Back
Top