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

Fatal error: Uncaught CurlException: 6: name lookup timed out thrown in /home/cudillan/public_html/jaren/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 996