2nd Post on VB Coding for Count by Month

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need extensive help on this in laymens terms.
I have a form that I use to create a file on a child admission.
I need to count how many children were admitted for a month and display on
the form. I tried various codes and they do not work. I am probably doing
it wrong.
So basically, when staff admit a new child, they see the date, beside the
date I would like a text box to show what count we are at for the month. The
count would need to be reset to Zero each month. Is there a simple way?????


Please help.

Thanks in advance.....
 
So basically, when staff admit a new child, they see the date, beside the
date I would like a text box to show what count we are at for the month. The
count would need to be reset to Zero each month. Is there a simple way?????

Yes.

Set the Control Source of the textbox to

=DCount("*", "<some table name that you have not told us>",
"[datefield] >= #" & DateSerial(Year(Date()), Month(Date()), 1) & "#")

where datefield is the field in the table indicating the date of
admission.

John W. Vinson[MVP]
 
Back
Top