Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6086937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:48:47+00:00 2026-05-23T11:48:47+00:00

I am using MS Access 2007. A: DCount([Name],[Main],[Name] = ‘Mark’)/ DCount([Entry],[Main],[Entry] = 1) Okay,

  • 0

I am using MS Access 2007.

A: DCount("[Name]","[Main]","[Name] = 'Mark'")/
   DCount("[Entry]","[Main]","[Entry] = 1")

Okay, so I am basically counting the number of people with the name Mark and I am dividing it by the number of Entry’s that = 1 in my database. That’s easy enough, but I am trying to apply a third condition, where

[Location]![City] = ‘Chicago’

, but Access isn’t letting me do this (It can’t find the table, even though it’s in the table I specified above.

   DCount("[Name]","[Main]","[Name] = 'Mark' AND [Location]![City] = 'Chicago'")/
   DCount("[Entry]","[Main]","[Entry] = 1")

I have also tried filtering the city with a Where clause in the Design view, but the condition is being applied after the calculation above, so the calculation is the same regardless of the city. I just need it to perform the above calculation for the city of Chicago.

Is something like this possible with DCount?

Also, I would die a happy man if you could tell me how to Group By the city While performing the calculations for each one separately, but I would also be very thankful if someone could just show me how to do it the first way too.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:48:47+00:00Added an answer on May 23, 2026 at 11:48 am

    What is [Location]![City]? My answer is based on the presumption it refers to a field named City in a table named Location.

    If that is correct, I think your problem is because you’re attempting to specify a condition based on a field which is not part of the domain ([Main]) you told DCount to use.

    From Microsoft’s Documentation, the domain is “A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter.“

    So if you want your DCount criteria to refer to fields in two tables, consolidate the tables in the form of a query into a single “domain”. Maybe your query could be something like this, “qryMainWithCity”:

    SELECT m.[Name], m.Entry, m.City_ID, l.City
    FROM
        Main AS m
        INNER JOIN Location AS l
        ON m.City_ID = l.City_ID;
    

    If that query works for your situation, you should be able to get what you want with a DCount expression like this:

    DCount("*","qryMainWithCity","[Name] = 'Mark' AND City = 'Chicago'")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem in a Database using Access 2007 as front end
as example, I've the following SQL query ( using Access 2007 ) SELECT ID,
Using MS Access 2007, I am creating a student management database. I have tables
I am using Microsoft Access 2007 to move and massage some data between two
So I wrote a project-management program for a small business using Microsoft Access 2007.
Background info : I was handed a Tool, which was made using MS-Access 2007,
Is there any way of coaxing Access 2007 into using a .UDL file? Specifically,
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I am using Access 2007 to create an SQL query to join two tables.
Using Access 2007 vba addressing an Excel 2007 workbook (WB).... This routine adds a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.