Count specific combobox records in sunform

  • Thread starter Thread starter Silvio
  • Start date Start date
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.
 
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))
 
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))
 
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))
 
Back
Top