Count specific combobox records in sunform

S

Silvio

I have a control in the main form with the following Control Sorce:
=[frmHolds].[Form].[RecordsetClone].[RecordCount] that count the number of
records in my subform. However, now I need to count only specific records
where the column(0) of the combobox in my subform (TXHolds) is = 6 how do I
go by in doing this? In few words, count in my subform how many
txholds.colums(0) = 6 I have.
 
M

Marshall Barton

Silvio said:
I have a control in the main form with the following Control Sorce:
=[frmHolds].[Form].[RecordsetClone].[RecordCount] that count the number of
records in my subform. However, now I need to count only specific records
where the column(0) of the combobox in my subform (TXHolds) is = 6 how do I
go by in doing this? In few words, count in my subform how many
txholds.colums(0) = 6 I have.


If the BoundColumn is the one you want to count, then use a
footer text box with an expression like:
=Sum(IIf(thetablefield - 6, 1, 0))
 
S

Silvio

Marshall as usual you are the best! Did you mean =6 or it should be -6?

Marshall Barton said:
Silvio said:
I have a control in the main form with the following Control Sorce:
=[frmHolds].[Form].[RecordsetClone].[RecordCount] that count the number of
records in my subform. However, now I need to count only specific records
where the column(0) of the combobox in my subform (TXHolds) is = 6 how do I
go by in doing this? In few words, count in my subform how many
txholds.colums(0) = 6 I have.


If the BoundColumn is the one you want to count, then use a
footer text box with an expression like:
=Sum(IIf(thetablefield - 6, 1, 0))
 
M

Marshall Barton

Yes that should be =6

With the minus sign, it would have been a weird way of
counting the records that were not equal to 6.
--
Marsh
MVP [MS Access]

Marshall as usual you are the best! Did you mean =6 or it should be -6?

Marshall Barton said:
Silvio said:
I have a control in the main form with the following Control Sorce:
=[frmHolds].[Form].[RecordsetClone].[RecordCount] that count the number of
records in my subform. However, now I need to count only specific records
where the column(0) of the combobox in my subform (TXHolds) is = 6 how do I
go by in doing this? In few words, count in my subform how many
txholds.colums(0) = 6 I have.


If the BoundColumn is the one you want to count, then use a
footer text box with an expression like:
=Sum(IIf(thetablefield - 6, 1, 0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top