Combo box based on anothr combo box

T

Tknows

i'm trying to generate a combo box list based on the selection of another
combo box. I aslo need to requery the second combo box once a selection is
made in the first combo box.
the select query in the row source of the second combo box is the following:

[Form]![SelectPicture]![cboPicYear (1)]

This appears as a parameter in form view.
The SQL seems correct:
SELECT Picture.PictureId, Picture.PictureDescription, Picture.Location,
Picture.members, Picture.PositionDescription
FROM Picture
WHERE (((Picture.PicYear)=form![SelectPicture]![cboPicYear]))
ORDER BY Picture.PictureDescription;

Please note teh cboPicYear has two columns one for the ID and the other for
the picture year. The picture year is the value that is displayed in the
combo box.
 
O

Ofer Cohen

Look at this link on "Limit content of combo/list boxes" for example

http://www.mvps.org/access/forms/frm0028.htm

Also, this line
form![SelectPicture]![cboPicYear]

Should be with Forms and not Form:
forms![SelectPicture]![cboPicYear]

If you want to Access the second column in the Combo, create a text box in
the form (not visible) and set it to the second column.
In the ControlSource of the text box write
=[ComboName].Column(1)

Then, filter the query by this text box
Forms![SelectPicture]![TextBoxName]
 
T

Tknows

the real issue I guess is that I expect the second combo box to generate a
set of values based on the selection of the first combo box. Instead each
item I select generates a parameter box. how do I elimnate this. My snytax
is in the second combo box is:
SELECT Picture.PictureId, Picture.PictureDescription, Picture.Location,
Picture.members, Picture.PositionDescription FROM Picture WHERE
(((Picture.PicYear)=[forms]![Select_Picture]![txtYear])) ORDER BY
Picture.PictureDescription;:

A requery in the after update of the first combo box does not seem to work

Ofer Cohen said:
Look at this link on "Limit content of combo/list boxes" for example

http://www.mvps.org/access/forms/frm0028.htm

Also, this line
form![SelectPicture]![cboPicYear]

Should be with Forms and not Form:
forms![SelectPicture]![cboPicYear]

If you want to Access the second column in the Combo, create a text box in
the form (not visible) and set it to the second column.
In the ControlSource of the text box write
=[ComboName].Column(1)

Then, filter the query by this text box
Forms![SelectPicture]![TextBoxName]

--
Good Luck
BS"D


Tknows said:
i'm trying to generate a combo box list based on the selection of another
combo box. I aslo need to requery the second combo box once a selection is
made in the first combo box.
the select query in the row source of the second combo box is the following:

[Form]![SelectPicture]![cboPicYear (1)]

This appears as a parameter in form view.
The SQL seems correct:
SELECT Picture.PictureId, Picture.PictureDescription, Picture.Location,
Picture.members, Picture.PositionDescription
FROM Picture
WHERE (((Picture.PicYear)=form![SelectPicture]![cboPicYear]))
ORDER BY Picture.PictureDescription;

Please note teh cboPicYear has two columns one for the ID and the other for
the picture year. The picture year is the value that is displayed in the
combo box.
 

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