Display Query Results in MS Access using Mutiple Fields and 1 Text box with DCOUNT()

In Continuation of my recent post : Civil Registry App in Microsoft Access – Finally!

Encountered an issue in access where I need to get the values of Gender and Age.

Display Query Results in MS Access using Mutiple Fields and 1 Text box with DCOUNT().

Now What I need to do is to count the total number of male or female residents based on the age using the query, and I need to display those calculated values in a textbox. After sorting and scouring info in the web.

I decided to use DCOUNT().

I translated the problem with an SQL statement.

Select Count (AGE) and (Gender) From TotalPOP as totalpopbyage Where AGE = 24 and gender = female

using Dcount(name of field, queryname, criteria)

I tried =DCount(“AGE”,”totalpop”,” AGE = 24 AND gender=’female’”)

because of the dcount format I was following, errors kept showing if I added both criterias gender and age but it works fine with just one criteria

until I came up with this by accident.

=DCount(“gender” And “AGE”,”totalpop”,” AGE = 24 AND gender=’female’”)

… sometimes the solution is in front of our noses, it’s how you look at it.

Basically reviewed these articles for the solution.

I’ll be back with more misadventures and my quick fixes.

Enhanced by Zemanta

Jaren Cudilla

Gamer, Blogger, Ninja, Coffee Lover, Gardener… blogs about Tech stuff, Video Games, sarcasm, gadgets, blogging tutorials, tips, tricks, PC Troubleshooting plus some additional skills/talents that he acquired these past few years he was under a rock, like World of Warcraft, Diablo 3, Ruby on Rails and many more.

More Posts - Website

Follow Me:
TwitterGoogle Plus

One thought on “Display Query Results in MS Access using Mutiple Fields and 1 Text box with DCOUNT()

  1. Hi, I just noticed that sometimes this site displays an 404 error message. I figured that you would like to know. All the best

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge