PDA

View Full Version : Solved: Query Creation



kbsudhir
08-16-2008, 01:56 PM
Hi,

I have a table with 2fields.
1. Category
2. Updates

Now I have a form with list box which is linked to the category field of the table.

Now I want to display the updates filed of that particular category which is selected by the user from the list box.

I want to know how to do this, in both access 2007 & 2003.

:think: :think:

Any help or guidance regarding this is appreciated.

Thanks
Sudhir

Ray0729
08-16-2008, 04:50 PM
If I am understanding what you are asking, after the user makes a selection you want the the second box to list all updates. This is how I would do it. Both fields on the form have been set up as List Boxes .

Catergory = CtgLstBx
Updates = UpLstBx

CtgLstBx Row Source Type = Table/Query
CtgLstBx Row Source = SELECT [TableNameHere].[Catergory] FROM TableNameHere;

UpLstBx Row Source Type = Table/Query
UpLstBx Row Source = SELECT [TableNameHere].[Updates] FROM TableNameHere WHERE ((([TableNameHere].[Catergory])=[Forms]![Main]![CtgLstBx]));

Now assign the following code to CtgLstBx (I assigned it to On Click)

Private Sub CtgLstBx_Click()
[Forms]![Main]![UpLstBx].Requery
End Sub

That's the easiest way I can think to do it. Hopefully I was correct in answering your question. It should work for both 03 & 07.

- Ray

kbsudhir
08-18-2008, 06:54 AM
sHi Ray,

Thanks for your guidance. But instead of displaying updates in a list box i.e (in UpLstBx). I want them to be dispayed in a textbox, in a bulleted format.

How to go about doing it.

Thanks
Sudhir