Discussion Locked

Access Combo Box

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I work for a Public School. I have created a database for teachers to post and search lesson plans.

I created a combo box where teachers can select what grade levels the lessons are for. However, they can only select one grade level.

Is there a way to allow them to select more than one grade level at a time? They would like to query based upon grade level, so entering multiple grade levels would be the ideal situation to have.

I would appreciate any advice. I am a "newbie" at Access and this has me completely stumped (and other Access users here in the corporation I talked to).

Thanks!

9 replies

by donq

insert a "BETWEEN ... AND" clause inside the "Grade Level" column in the criteria field of the query that produces your Combo box records.

Users will then be requested to enter a beginning and ending range - See on-line help for the Between operator.

Good Luck - it's easy to apply but you'll need a "query" recordsource.

by dklippert

Go to the Help file and look up the MultiSelect property. There's a pretty good description about how to use it.

by jacmari

I don't know if it can be done using a combo box. I'm sure there is a way. But if you are willing to change it to a listbox, there is the Multiselect option. It can be found by Right-clicking on the listbox (design view) -> Properties -> Other tab, and select extended under Multiselect.

Hope this helps.

by richtee

A solution of changing the combo box to a list box, changing the ?Multiselect ?option, and then entering the SQL code behind the command button to use the multiple selections as criteria for your query is probably the best overall solution. But youwill need the code to process the multiple selections, which you can find in the MS Knowledge Base.

If you have trouble with the multiselect code to work for you the following alternative method might help: Use the Instr() function as a field in your query. It is straightforward and quite simple.

Go to your query, in design view, in a blank column, and assuming [GradeLevel] is the name of the field being referenced, use the following:

Field InStr([Enter Grade Levels separated by commas, Blank = All], [GradeLevel])
Criteria > 0 Or Is Null
Show False

When you run the query an Input Box will pop up requesting the entry of multiple Grade Levels separated by commas. The above example will also bring back all records if there is no input.

Good Luck
Rich

This discussion is closed to new replies.