| re: Display recordcount of a sub form in a main form
Use the DCount domain aggregate function in the Control Source for each
TextBox. It provides for criteria, and, if you desired, you could base it on
a saved Query.
Larry Linson
Microsoft Access MVP
"Hasanain F. Esmail" <hasanainf@yahoo.com> wrote in message
news:27c08a7a.0401202123.152cc9ce@posting.google.c om...[color=blue]
> Hi All,
>
> I am using A2 for this database.
>
> I have a main form with bound fields of FlightNumber and FlightDate
> I also have a subform. This subform takes details of a passanger along
> with other details. I also have a textbox called status in subform.
> When a passanger's details are entered, status value is set to
> "confirmed", when passanger calls in to reconfirm flight, status value
> changes to "Reconfirmed", and when passanger calls in to cancell
> his/hres flight, status value is set to "cancelled". Sometimes, status
> textbox may also have a value of "Wait Listed". A subform may have
> 17 to 25 records with different vales in status textbox.
>
> Typical situation:
> 13 records with value of "Reconfirmed" in status textbox
> 4 records with value of "Confirmed" in status textbox
> 1 record with value of "Cancelled" in status textbox
> 2 records with value of "Wait Listed" in status textbox
>
> Om my main form I want to have four unbound text box to show the value
> as follows:
> Reconfirmed 13
> Confirmed 4
> Cancelled 1
> Wait Listed 2
>
> How do I get these values displayed using VBA.
> I know it can be done using recordcount method but dont know how to code[/color]
it.[color=blue]
> I need your help with full syntax.
>
> Many thanks in advance for your help.[/color] |