Results 1 to 8 of 8
  1. #1
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234

    Count rows in a list box since April 15th

    Hi all,

    I have a listbox that shows how many jobs an employee worked. I need to count the number of jobs they've worked since April 15th.

    I figured I can either use listcount, or maybe build a query that takes the information from tblRelEventEmployee. However, I'm not sure the exact wording of either. The fact that it's only jobs since 4/15/15 makes it a little out there for me.



    Attached is a picture of the listbox and the unbound textbox for the count.

    Click image for larger version. 

Name:	events.png 
Views:	14 
Size:	13.0 KB 
ID:	21942

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if the query shows all records since the date,
    set the textbox rowsource : =lstbox.rowcount

  3. #3
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Unfortunately, the listbox shows all events since the DB has been in use (since 2000). So I need it to only find the records since April 15th of this year.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    then put 2 boxes
    1 for this limiter date , txtDate
    1 for the count, txtCount = Dcount("*","table","[date]=#" & txtDate & "#")

  5. #5
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Quote Originally Posted by ranman256 View Post
    then put 2 boxes
    1 for this limiter date , txtDate
    1 for the count, txtCount = Dcount("*","table","[date]=#" & txtDate & "#")
    Am I understanding this correctly... put one text box, named txtDate with just "4/15/2015" as the data, and then that formula in txtCount?

  6. #6
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Any other input on this one? I'd like to figure this out, assuming it's possible.

    Thanks all!

  7. #7
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    I'd like to open this back up to the group. I'm still working on this issue, and I haven't been able to move forward as yet. Does anyone have any input here?

    Thank you.

  8. #8
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    Quote Originally Posted by bradp1979 View Post
    Am I understanding this correctly... put one text box, named txtDate with just "4/15/2015" as the data, and then that formula in txtCount?

    Set the ControlSource for your text box control to:


    = Dcount("*","[table name]","[date field name in table]>=#4/15/2015#")


    Replace "table name" and "date field name in table" with appropriate actual names and you're good to go.
    There's an added greater than symbol included here.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Count Rows in a Filtered Report
    By vefizoo in forum Reports
    Replies: 2
    Last Post: 11-22-2014, 11:47 PM
  2. Replies: 3
    Last Post: 12-16-2013, 10:29 AM
  3. regarding list count
    By ritimajain in forum Forms
    Replies: 1
    Last Post: 07-17-2013, 11:15 PM
  4. Query using all rows of a list box
    By oleBucky in forum Queries
    Replies: 7
    Last Post: 05-07-2011, 01:39 PM
  5. Replies: 1
    Last Post: 01-24-2011, 03:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums