Results 1 to 5 of 5
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494

    Use dcount in a query

    I am trying to use a totals query with a count of records as the field value in another query.

    I tried to do it like this

    RecordCountcount("myfield", 'myquery")



    However that doesnt work. What is the best way to do this?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    you dont use Dcount in a query, the query does the counting.

    but if you want to use Dcount in a form:
    Dcount ("*", "queryname")

  3. #3
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    Sorry, typos

    RecordCountcount("myfield","myquery")

    The query will run fine but it does not update the RecordCount field in the table

  4. #4
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    Ok, I don't need it in a form.
    I am updating a table that has two rows. I update some customer information but then I need to update the RecordCount, Total Labor and Total Materials from a different totals query.

    How can I pull the vaules from that query into this query?

  5. #5
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    Silly emoji thing, have to put it in code

    Code:
    RecordCount:Dcount("myfield","myquery")

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

Similar Threads

  1. Dcount in Access 2010 query
    By haqm1960 in forum Queries
    Replies: 1
    Last Post: 07-21-2016, 02:14 AM
  2. DCount for filtered query
    By ittechguy in forum Programming
    Replies: 1
    Last Post: 10-12-2015, 10:39 PM
  3. Dcount of Query in VBA gives Error 3219
    By krausr79 in forum Access
    Replies: 2
    Last Post: 10-20-2014, 12:00 PM
  4. Dcount on Query design
    By thanosgr in forum Queries
    Replies: 8
    Last Post: 04-29-2012, 08:29 AM
  5. Dcount query
    By ramdandi in forum Queries
    Replies: 1
    Last Post: 12-27-2011, 01:30 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