The requery of the list box worked for me. The form was a single form view
but it should also work on a continuous although I'm not sure how/why you
would have a list box (not a combo box) in a continuous form.
Can you share your code?
--
Duane Hookom
Microsoft Access MVP
:
I did discover the need to requery after changing the Level1 field. However,
the problem still exists that all of the queries to set the values for the
listbox of Level2 field are using the value of the Level1 field in the first
record... not the record for which I am currently selecting the listbox.
Thanks for the offer.
:
If your list boxes depend on a value in the current record, you will need to
requery the list box in the On Current event of the form.
--
Duane Hookom
Microsoft Access MVP
:
In any form that shows multi records, split form or datasheet view, the same
problem occurs. I can't seem to have a query in one field of a row that uses
the value from a different field of that same row. I got something that at
first seemed to work but it uses the value for the specified field always in
record #1 not the current record. This is as shown...
For the RowSource for the listbox of Level2 I have the folloing query
SELECT Topics.ID, Topics.TopicL2, Topics.TopicL1
FROM Topics
WHERE (((Topics.Topics.TopicL1)=[Level1]))
ORDER BY Topics.TopicL1, Topics.TopicL2;
PROBLEM is that Level1 here seems to always refer to the Level1 field of
record #1 even if I'm selecting the Level1 field of a different row in the
datasheet. How do I make this reference to the field "Level1" refer to the
correct current record?
Please... if anyone knows how to do this, I would be very grateful.
Thanks
:
You can't do it in a table but that's okay since you shouldn't be using
tables for user interface. Use forms. I also don't like lookup fields defined
in tables.
--
Duane Hookom
Microsoft Access MVP
:
Given that I'm using this just in a table, not a form, I'm still not sure how
to refer to the listbox in a different field. Is this not possible in a
table? I can't figure out how to refer to the value in another field to put
in a WHERE clause of a query for another field's listbox.
:
See this article -- it discusses comboboxes, but is equally applicable to
listboxes:
http://www.mvps.org/access/forms/frm0058.htm
--
Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
In a table I'm wanting to have a field be a listbox where the selectable
values are grabbed from a second table. I want to limit this using the
value
in a different field of the first table... how do I specify this in the
query.
Lets say I have fields Level1 and Level2 in Table1 and a list in a table
called Topics that has TopicL1 and TopicL2 as the allowable level 1 and
level
2 topics. In the first table I've got a query that limits the entry for
Level1 to the values in TopicL1 of Topics. I can't figure out how to
construct a query for a listbox for Level2 that uses the value in Level1
to
limit the TopicL2 entries shown to only those with a matching TopicL1 =
Level1 value.
I'm fairly new to databases and Access... all help greatly appreciated.
Thanks