By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

Display recordcount of a sub form in a main form

P: n/a
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 it.
I need your help with full syntax.

Many thanks in advance for your help.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <ha*******@yahoo.com> wrote in message
news:27**************************@posting.google.c om...
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 it. I need your help with full syntax.

Many thanks in advance for your help.

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.