Grouping query results - From a Combo box (1 Viewer)

EllisHudson

New member
Local time
Today, 11:33
Joined
Nov 8, 2020
Messages
1
Hi,

I'm totally new to Access so I'm creating a test application around video games. I have a table for game genres, which my main game table uses a combo box so the user can just tick the genres when adding a new game.

SELECT [tbl_GameGenre].[Genre_ID], [tbl_GameGenre].[Genre_Name] FROM tbl_GameGenre ORDER BY [Genre_Name];

The next step is to be able to search for games using Genre. My query is:

SELECT tbl_Game.Game_Genre.Value, tbl_Game.Game_Name
FROM tbl_GameGenre INNER JOIN tbl_Game ON tbl_GameGenre.Genre_ID = tbl_Game.Game_Genre.Value
GROUP BY tbl_Game.Game_Genre.Value, tbl_Game.Game_Name;


However this does not return the data in the format I need. I would like it to be grouped by Genre, then have a list of games which come under that genre. When I try to remove the name from the grouping list, I get there error: Your query does not include the specified expression "Game_Name" as part of an aggregate function.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:33
Joined
May 7, 2009
Messages
19,233
firrst, you add Criteria to your last query and involving the Combo on the Form..
second, don't use Total query in your query, you cannot add record to this kind of query.
third, don't use Multivalue field, it's hard to manipulate.
just add a Genre_ID to tbl_game.

you will need to create a form (continuous or datasheet) from tbl_game.
drag it to your form that has the combobox (thus making it a subform).
on it Link Master/Child Fields property, put Genre_ID on both.
 

Users who are viewing this thread

Top Bottom