473,388 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Display recordcount of a sub form in a main form

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
1 2233
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Carl | last post by:
I have a main form with navigation buttons on it and a label showing for example Record 1 of 15 using recordsetclone on it and eveything works fine. When I move through the records the record...
3
by: Cillies | last post by:
Hi, I want to display the number of records in a form on an access 2002 database. I know that under properties you can select navigation button, which allows the user to flick through the...
9
by: Sandy | last post by:
Hi all, I have a form to list records (frmListIssue) which I call from different other forms. My wish is to display a message when the form is called and empty; no records to display. I want to...
0
by: mkd1919 | last post by:
I have a website that performs a search on an indexing service and returns the results. During the initial load, I get the recordcount through a DS, then bind a DataList using a second DS with...
2
by: Keith Wilby | last post by:
I have a simple form/subform arrangement with a 1:M relationship. I want to limit the number of records at the many end to a maximum of 4 per "main" record - what's the best way? I've tried this...
3
by: nkechifesie | last post by:
I want my form to display the absolute position and the recordcount of the records in the database but it keeps shoing me -1 for both . Why? this is the code Private Sub MnuOVehType_Click()...
36
by: beebelbrox | last post by:
Hi, I am new VB programming in Access and I am requesting help with the following code. WIndows OS MSaccess 2003 This code is attached to an unbound form that will display a specific recordset...
1
idsanjeev
by: idsanjeev | last post by:
<%@ Language =vbscript%> <% Option Explicit %> <html> <head><TITLE>VOICE OF BARAUNIANS</TITLE></head> <body> <!--#include file="front.inc"--> <div style="Position:Absolute; width:700; TOP:0;...
4
by: Greg (codepug | last post by:
I want to display the last 22 records in my continuous form. I have writen the following code and it works, but was wondering if there were any better suggestions for accomplishing this. My code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.