Results 1 to 6 of 6
  1. #1
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141

    Create a form - that lists all current employees and Dcount of Activity

    I tried Continuous form that lists (from Query) all current Employees. Then unbound Text box with DCount formula.



    I have Table Employees and Table Activity

    I have a Query1 that lists activity for current month
    I have a query2 that lists current employees (ExitDate Is Null).

    I want a form that - lists all the current Employees (Query2)
    And a count from Query1 (if there are no records for that employee the 0)

    The reason I would like it on a continuous form: I don't want to have to edit the form design every time there is a new employee or an employee leaves.


    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why would a non-continuous form require editing form design when employees come/go?

    Post your attempted DLookup expression. Why does it not work, what happens - error message, wrong results, nothing?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141
    Code:
    =DCount("[AccountName]","Q2ActivityTeam","[TypeDescription]='Call'")
    On the continuous form - this counts the calls for all the employees in the Query
    Code:
    =DCount("[AccountName]","Q2ActivityTeam","[TypeDescription]='Call' AND [PersonnelName]=" & [TxtPersonnelName])
    Returns #Error - Q2ActivityTeam contains [PersonnelName] I named the Text box on the form [TxtPersonnelName]

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Parameters for text type field need apostrophe delimiters.

    =DCount("[AccountName]","Q2ActivityTeam","[TypeDescription]='Call' AND [PersonnelName]='" & [TxtPersonnelName] & "'")

    Really should search on personnel ID not name because names make poor unique identifiers. What if you have multiple Jane Smith?

    Name parts should be in separate fields: FName, MName, LName, Prefix, Suffix
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141
    Yeah, I am looking into someone else's SQL - but should have keyed it to the PersonnelID

    And that worked (the '" & "'") - How would you do it without a continuous form?

    Thanks for the help!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    How are you doing it on Continuous form - textbox in form footer section? Do the same on Single View form.

    Would not work for Datasheet View.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Create a holiday DB for 30 employees
    By djspod in forum Database Design
    Replies: 2
    Last Post: 09-22-2015, 03:51 PM
  2. Replies: 3
    Last Post: 03-09-2013, 09:58 AM
  3. Replies: 2
    Last Post: 04-16-2012, 12:56 PM
  4. Replies: 1
    Last Post: 11-23-2010, 09:16 PM
  5. How to Close access form after no activity
    By russ0670 in forum Forms
    Replies: 1
    Last Post: 05-17-2010, 08:17 AM

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