Conditional Recordcount

  • Follow


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

0
Reply Shiller 10/19/2007 3:31:09 PM

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.

"Shiller" wrote:

> 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
> 
> 
0
Reply Utf 10/19/2007 3:41:01 PM


On Fri, 19 Oct 2007 15:31:09 -0000, Shiller wrote:

> 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] 
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
Reply fredg 10/19/2007 4:01:51 PM

On Oct 19, 12:01 pm, fredg <fgutk...@example.invalid> wrote:
> On Fri, 19 Oct 2007 15:31:09 -0000, Shiller wrote:
> > 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]
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail

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")

0
Reply Shiller 10/19/2007 4:51:25 PM

On Oct 19, 12:51 pm, Shiller <shill...@gmail.com> wrote:
> On Oct 19, 12:01 pm, fredg <fgutk...@example.invalid> wrote:
>
>
>
> > On Fri, 19 Oct 2007 15:31:09 -0000, Shiller wrote:
> > > 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]
> > --
> > Fred
> > Please respond only to this newsgroup.
> > I do not reply to personal e-mail
>
> 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.

0
Reply Shiller 10/24/2007 7:46:02 PM

4 Replies
348 Views

(page loaded in 0.121 seconds)

Similiar Articles:
















7/17/2012 7:05:03 AM


Reply: