Connecting Tech Pros Worldwide Forums | Help | Site Map

Yet another list box problem

ormy28
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi, back again with another list box problem, 3rd in two days!

I am wanting to create a list box that lists all the results of a
query. I am using Access 2000, and I'm sure this is easier to do in
Access 2003, but seeing as I don't have it I'll have to make do! using
the list box wizard I try to base the list box on the query i am using
(qryAvailable_Cars). However i always receive an error message saying
"No value given for one or more required parameters".

Therefore, i decided to use the following code as the Row source for
the list box:

SELECT [qryAvailable_Cars].[Car ID], [qryAvailable_Cars].[Reg Number],
[qryAvailable_Cars].[Type], [qryAvailable_Cars].[Fuel Type],
[qryAvailable_Cars].[Gearbox] FROM qryAvailable_Cars;

(The query qryAvailable_cars contains the fields Car ID, Reg Number,
Type, Fuel Type, Gearbox)

However, when i do this, the list box only returns the first field of
all the records, Car ID. this is pretty pointless! There is probably a
mistake with the above coding. would be grateful for any pointers.
thanks

davidjpike@lycos.co.uk
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Yet another list box problem


Your query is fine, you need to look at the properites of the listbox
in design view (on your form?).

Double click on the listbox, on the box that pops up - look at the
format tab. Then change the column count to more than one. Of course
this will in the end only display the Card ID, but on clicking the box
- when it drops down you'll see the other values (also you may have to
change the width of the listbox).

Dave

fredg
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Yet another list box problem


On 23 Dec 2004 12:19:39 -0800, ormy28 wrote:
[color=blue]
> Hi, back again with another list box problem, 3rd in two days!
>
> I am wanting to create a list box that lists all the results of a
> query. I am using Access 2000, and I'm sure this is easier to do in
> Access 2003, but seeing as I don't have it I'll have to make do! using
> the list box wizard I try to base the list box on the query i am using
> (qryAvailable_Cars). However i always receive an error message saying
> "No value given for one or more required parameters".
>
> Therefore, i decided to use the following code as the Row source for
> the list box:
>
> SELECT [qryAvailable_Cars].[Car ID], [qryAvailable_Cars].[Reg Number],
> [qryAvailable_Cars].[Type], [qryAvailable_Cars].[Fuel Type],
> [qryAvailable_Cars].[Gearbox] FROM qryAvailable_Cars;
>
> (The query qryAvailable_cars contains the fields Car ID, Reg Number,
> Type, Fuel Type, Gearbox)
>
> However, when i do this, the list box only returns the first field of
> all the records, Car ID. this is pretty pointless! There is probably a
> mistake with the above coding. would be grateful for any pointers.
> thanks[/color]

You need to set the column count to 5.
Set the Bound Column to 1.
Then also set the column widths property to:
0",1";1";1":1"
This will hide the bound ID column and display all the others in a
1-inch column.
You can increase or decrease the column widths as needed.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Closed Thread