Run Report using ListBox selection

K

K.R

Hi All,

I have a form called "frm pick team member" and a list box on it called
"picklist".
I want to be able to run a query from this form, after the person has
clicked the info they want.

Currently i have it set up as follows:

the user opend the frm, clicks on one of the list box options, which then
activates a macro to open the query. the query criteria has the following in
the field which i want to take from the picklist selection:

[Forms]![frm pick team member]![picklist]

However, whenever i run it the query comes up blank.

What am i doing wrong, and is there a way to do this in code which i more
simple?

Any suggestions greatfully accepted....

K.R
 
K

Klatuu

It depends on whether your List Box allows multiple selections. If it does,
this will not work. A multi select List Box will return Null if you
reference as you do in your code.

If you are only selecting one team member, you would be better off to change
it from a List Box to a Combo Box. It will work much better in this
situation. In addition, the Combo Box has the Auto Expand (type ahead)
property that the List Box does not have. This makes finding a member much
easier for the user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top