Combobox+filter

zzteam

Registered User.
Local time
Today, 07:40
Joined
Nov 24, 2005
Messages
36
Hi everybody,

I make for my friends database for comics
but I have problem with combobox.
Database is MS2007.
I have table with genres of comics,
but how I can make combobox which I choose one genre
that only show comics with this genre?
Combobox for filter is in left top angle.

please see my database and give me any solution.
Thank you in advance.
 

Attachments

The combobox needs to use a SELECT statement from the Genre table as its RowSource: SELECT tblGenre.Type FROM tblGenre

However you really should use a number for the Key field of the Genre table and another field for the genre name. The key value is used as the genre in the comic table rather than the genre name. This allows you to change the genre name without having to change it in all the comic table records. It also saves storage space in tables and time on queries.

In this case your combobox needs a RowSource: SELECT tblGenre.Keyfield, tblGenre.Name FROM tblGenre

In the combobox properties set:
Column Count: 2
Column Width: 0cm;5cm
Bound Column: 1

This makes the Key field the value of the box but displays the name.

Wherever you refer to the comic table and need it filtered by the genre combo you include as part of the SELECT statement:
WHERE tblComic.Genre = cmboGenre (assuming these are the comic table and genre combobox names)

You will need to either refresh or requery other controls or subforms when you change the selection in the Genre combobox.

Hope this helps. Good luck.
 
I try but without effects. That's for me spanish village :(
Can you upload sample if is not big problem for you?

Thank you in advance,
zz
 

Users who are viewing this thread

Back
Top Bottom