Conditional Recordcount

  • Thread starter Thread starter Shiller
  • Start date Start date
S

Shiller

Experts,

I'm trying to get a record count based on the value in the combox.
For example if 2 records are marked "completed" out of 5, I want 2 as
my record count.

Please help!

thanks
 
I don't understand. The RecordCount is a PROPERTY of a recordset, and is only
available to you when you create and open a recordset. You cannot "set" its
value to something.
 
Experts,

I'm trying to get a record count based on the value in the combox.
For example if 2 records are marked "completed" out of 5, I want 2 as
my record count.

Please help!

thanks

it's not clear at all what you are asking.
Perhaps you mean.......
Using an unbound text control on your form:

=DCount("*","TableName","[FieldInTable] = '" & [ComboName] & "'"

The above assumes the [FieldInTable] datatype is Text.

If it is a Number datatype, then use:

=DCount("*","TableName","[FieldInTable] = " & [ComboName]
 
I'm trying to get a record count based on the value in the combox.
For example if 2 records are marked "completed" out of 5, I want 2 as
my record count.
Please help!

it's not clear at all what you are asking.
Perhaps you mean.......
Using an unbound text control on your form:

=DCount("*","TableName","[FieldInTable] = '" & [ComboName] & "'"

The above assumes the [FieldInTable] datatype is Text.

If it is a Number datatype, then use:

=DCount("*","TableName","[FieldInTable] = " & [ComboName]

I'm trying to get the counts from a combobox on my subform based on
certain criteria. I've been experimenting with this piece of code
that supposedly can do that but it's not working:

DCount("*", Me.SubformName.Form.RecordSource,
IIf(Me.SubformName.Form.Filter = "", "", Me.SubformName.Form.Filter &
" And Len([Criteria] & """") > 0")
 
it's not clear at all what you are asking.
Perhaps you mean.......
Using an unbound text control on your form:
=DCount("*","TableName","[FieldInTable] = '" & [ComboName] & "'"
The above assumes the [FieldInTable] datatype is Text.
If it is a Number datatype, then use:
=DCount("*","TableName","[FieldInTable] = " & [ComboName]

I'm trying to get the counts from a combobox on my subform based on
certain criteria. I've been experimenting with this piece of code
that supposedly can do that but it's not working:

DCount("*", Me.SubformName.Form.RecordSource,
IIf(Me.SubformName.Form.Filter = "", "", Me.SubformName.Form.Filter &
" And Len([Criteria] & """") > 0")

I took a simpler approach, I created separate queries with different
criteria to update the table a criteria at a time.
 
Back
Top