Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Still need help

Status
Not open for further replies.

tallguy804

IS-IT--Management
Apr 15, 2004
25
US
I still can't figure out what I am doing wrong. I have a field in a table that is derived from a dropdown box. The two options are "male" or "female".

I added the field to the query but I can't get the criteria set so that it will only select records with "male" in them. Someone suggested that I need to use the ID that is associated with "male" but I don't know how to find that.

Here is the information about the field from the database design window:
Display control: Combo box
Row Source: value list
row source: "Male";"Female"
bound column: 1
column count: 1
Column heads: no
colun width: 1"
list rows: 8
list width: 1"
limit to list: no

Thanks in advance for any help anyone can give me.
 
Based on what you have here, the values stored in the record should be 'male' or 'female' (without the quotes).
There is no ID involved.

Therefore you should be able to select records just by typing "male" (or "female") into the criteria cell of the query (Access will put quotes in if you don't).

If this is not working then please post the SQL view of your query so that someone can look at it.
 
When i put male into the criteria and runt he query i geta datamismach error.

There really is nothing in the query at this point. Only this one field. How do I get the sql view of it so that I can post it?
 
Nevermind.... coffee hasn't kicked in yet. Here is the SQL view for you.

SELECT Count(tblMain.Sex) AS CountOfSex
FROM tblMain
HAVING (((Count(tblMain.Sex))="male"));


Thanks
 
Put this back into the SQL view:

SELECT Count(tblMain.Sex) AS CountOfSex
FROM tblMain
where sex = "male"

If you want both figures in the same query then use:

SELECT sex, Count(tblMain.Sex) AS CountOfSex
FROM tblMain
Group by sex


 
Sweet mother THANK YOU! Now why oh why couldn't I get that to work? Who the hell knows! But I got it now and I am putting in all the othe fields and it is working just like I want.

Thanks again!
 

tallguy804,

Surely, shorely, Shirley, a thanks like yours should be accompanied by a STAR for Lupins46!

(if you'll forgive the nudge from a relative newbie!)

Tim

(you're not really [red]8'04"[/red], are you? heck, I thought I was tall at 6'4"...)

[blue]_____________________________________________________
If you need immediate assistance, please raise your hand.
If you are outside of Raleigh, raise your hand and say
[/blue] [red]Ooh! Ooh![/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top