Form for parameter query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

First off, I did go back and do a search in the forum and used that info to
get started. Thanks to all that contribute. I set up a form with a list box
and control button to run my query based on the list box selection. In the
query I referneced the form and list box for criteria. When I run the query
from the form, my list box looks great and includes all my selections but
comes up blank when run. Right now this is a very simple DB - one table, one
query, one form. I'm sure I'm just missing something. Anyone got any ideas?
I'm trying to get back into using access after several years away and it
obviously isn't going too well. Thanks
 
Are you making multiple selections in the listbox? If yes, then your setup
will not work. You must use code to generate the query if you use a
multiselect listbox on a form as a source of the criteria.

See this article on The ACCESS Web for info about multiselect listboxes in
queries:
http://www.mvps.org/access/forms/frm0007.htm
 
No multiple selections or anything. Trying to keep it as simple as possible
as I work my way up to the access novice that I was. I know without seeing
it the question is vague, just thoguht someone might have a thought on it.
Thanks
 
First off, I did go back and do a search in the forum and used that info to
get started. Thanks to all that contribute. I set up a form with a list box
and control button to run my query based on the list box selection. In the
query I referneced the form and list box for criteria. When I run the query
from the form, my list box looks great and includes all my selections but
comes up blank when run. Right now this is a very simple DB - one table, one
query, one form. I'm sure I'm just missing something. Anyone got any ideas?
I'm trying to get back into using access after several years away and it
obviously isn't going too well. Thanks

What "comes up blank"? The Form? The Query? Could you post the SQL of
the query and indicate what the listbox contains?

John W. Vinson[MVP]
 
Sorry. Guess some of that info would help. I can get the query to run
directly but comes up empty when I run it from the command button on the
form. The query SQL is:

SELECT [full database].ID, [full database].School, [full database].street,
[full database].city, [full database].state, [full database].zip, [full
database].County, [full database].Region, [full database].Phone, [full
database].lower, [full database].upper, [full database].Full_District, [full
database].Short_District, [full database].Name, [full database].Position,
[full database].Email
FROM [full database]
WHERE ((([full database].School)=[forms]![Form1]![List0]));

The list box displays the field School. The form is Form1 and the listbox
is List0. Thanks
 
Thanks for the help. I got it figured out.

scoopy2 said:
Sorry. Guess some of that info would help. I can get the query to run
directly but comes up empty when I run it from the command button on the
form. The query SQL is:

SELECT [full database].ID, [full database].School, [full database].street,
[full database].city, [full database].state, [full database].zip, [full
database].County, [full database].Region, [full database].Phone, [full
database].lower, [full database].upper, [full database].Full_District, [full
database].Short_District, [full database].Name, [full database].Position,
[full database].Email
FROM [full database]
WHERE ((([full database].School)=[forms]![Form1]![List0]));

The list box displays the field School. The form is Form1 and the listbox
is List0. Thanks

John Vinson said:
What "comes up blank"? The Form? The Query? Could you post the SQL of
the query and indicate what the listbox contains?

John W. Vinson[MVP]
 
Back
Top