Mike,
I tried your suggested solution and it didn't work. I also tried some
of the other suggestions with out luck. Maybe if I give more details
it will help.
tblPartNumber has a 1 to many relationship with tblTicketNumber
tblPartNumber has the following fields PartID (Auto Number),
PartNumber (Number), Completed (Yes/No)
I made a query from this table called qryPartNumber. The only
criteria is that Completed = No
tblTicketNumber has the following fields TicketID (Auto Number),
TicketNumber (Number), Completed (Yes/No), PartID (Number)
I made a query from this table called qryTicketNumber. The
criteria is that Completed = No and PartID =
[Forms]![frmPartNumber]![PartID]
I created a form called frmPartNumber. On the form are 2 unbound list
boxes. The first listbox has the Row Source as qryPartNumber. The
second list box has the row source as qryTickeNumber. Both list boxes
have column 1 (PartID) as the bound column. On the AfterUpdate Event
for the 1st list box I have Me.Requery.
When the form opens, the 1st list box lists all of the Part ID's from
the query. The second list box shows all of the Part ID's for the
first part number. If I click on the second part ID nothing changes
in the second list box. I have 2 problems: 1 - The second list box
does not update when I choose another part number (I'm not sure how to
requery the qryTicketNumber in code. 2 - I want the part Number and
Ticket Number to show up in the lists boxes, not the ID #'s
Any additional help you can provide would be much appreciated.
Best Regards,
Chris Vettese
Mike Storr <st******@sympatico.ca> wrote in message news:<1n******************************@40tude.net> ...
On 19 Feb 2004 14:12:58 -0800, chris vettese wrote:
I have a table called table1 that has a one to many relationship to
table2. What I would like to do is have a form with two list boxes on
it. The first list box will have a field from all of the records in
table1. When the user clicks on one of the records, the second list
box will show all of the records related to that from table2. Is this
possible? How can it be done.
Regards,
Chris Vettese
Without knowing what is in these tables I can only be general. Set the
rowsource for the first listbox to aquery that returns all the results you
want from table1. Make the bound column of this list box whichever field is
the related one from table2.
In the second list box set the rowsource to a query that returns all the
fields you want "...WHERE (table2.FieldName = forms!FormName!Listbox1);"
If necessary, use the AfterUpdate event of the first listbox to requery the
second. this way each choice in the first, will cause the second to change
its list.