×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Counting Records

Counting Records

Counting Records

(OP)
I have created a field that counts the records in a report but what I really want to do is count records with this twist.  I want a count of all records that contain a negative in lapstime field and I want a count of all records that contain a positive in lapstime field.  How would I accomplish this?

Thank you in advance,
Mary Beth

RE: Counting Records

Hi Mary Beth,

Look up info on the DCount function, something like

=DCount("[CustomerID]","Customers","[lapstime]<0")

should work as a Control Source of a textbox.

HTH,
Drew

RE: Counting Records

(OP)
I cant seem to get this to work...I will keep plugging away.

Any other suggestions would be greatly appreciated

RE: Counting Records

What is showing up in the field?  #Name? #Error, or the wrong number?

RE: Counting Records

(OP)
#error is showing up in the field.  What I typed is:

=DCount("[Laps Time]","YearlyQry","[Laps Time]<0")

I also substituted the first Laps Time for Person Responsible because that is what the footer was that it was in

The Name of the report used is "Yearly Report"
"YearlyQry" is the query that the report is created from...

Dont know if this helps but I sure hope that you can help.

I also tried setting an invisible control (Latecnt) with a control source:  =iif([Laps Time] < 0, 1, 0)
*** this part worked

but when I created a field in the footer and set its control source to =Sum([Latecnt]) it didnt recognize that Latecnt was a field and it prompted me for a value.

If you have any clues as to what I am doing wrong with either of these problems, please let me know... I am pulling hair out here...

Thank you once again,
Mary Beth

RE: Counting Records


I've kicked myself in the tail a few times for having a control which uses a calculation/formulae the same name as a field in the source table, is this what is happening?  Can you set the control source for any field within the table or query the report is drawing from, in the control in question successfully?

RE: Counting Records

(OP)
I figured it out... I just did iif statement within the query then calculated that field... I didnt realize that you couldnt sum a calc field... or something like that..

Thanks you for the advice.

Mary Beth

RE: Counting Records

Your welcome, and congrats ;)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close