Access 2007 Male, Female, Unisex Categories for either Gender
I'm fairly new to Access 2007. I'm an ERP functional consultant with programming experience close to none. I'm setting up an Access database for personal use. Let's say I have product categories as Male, Female, Unisex. I have product colors as black and white. When entering an order, I select a color (combo box) i.e black and then gender (combo box) i.e male. In the order form gender can be either male or female but not unisex. In prodcut id field (combo box) I need to see black items with male and unisex gender. When I set up the query in product id combo, the OR operator precedes the AND operator, then I see white items too. As a result I see all the male and unisex items. I couldn't find a way put an OR operator within an AND operator so to speak. I changed my approach and instead of placing Male, Female, Unisex in one field, I created two checkbox fields, Male and Female. This time I tried to query Products.Male=True if GenderCombo=Male, Products.Female=True if GenderCombo=Female along with color but no luck. Which approach do you recommend and what should be the query like. Thanks in advance for your help. Bekir.
Check your query script, and note that AND has a higher precedence than OR. You will have to use brackets to get exactly what you want. example: where productcolor = 'Black' and gender = 'Unisex' or gender = 'Male' this will give you all Black Unisex together with all Male of any color. What you want is probably: where productcolor = 'Black' and (gender = 'Unisex' or gender = 'Male') You could also write that as: where productcolor = 'Black' and gender in ('Unisex', 'Male')
Change MS Access to Exclusive on the fly
Update Procedure “N/A” to Empty String on MS Access
MS Access: How can I find out where Tables, Queries, Macros etc. are used?
INSERT INTO statement, new record: how to grab autoid number created?
In VBA, cannot use Access.Application object
Using VBA to Update a form recordset in Access 2007
How to be productive in Access VBA + SQL development?
creating queries during runtime in msaccess
MS-Access: Selecting rows to delete via joins
How to set up a development environment in MS Access
Access - Data Provider Not Initialised?
How to use SubSonic with MS Access database
NetBeans IDE 6.5 and Microsoft Access
What is the VBA syntax to access hidden tables in MS-Access?
How do you redimension an array in VBA?
Exporting to text using access query with parameters