I quite understand that asking the right question is as difficult as getting
the right answer
May I suggest that you change the lookup fields in your table so that they
are now text boxes. Use combo boxes in a proper form to achieve what you
need.
I'll make up table and field names to give you an idea of how to do this.
Replace them with the real names. If it's not clear enough, please give me
the table and field names and what you want to call your form and combos
Form is FrmChoice
One combo box named cboCategory will be based on your table containing
Security, Treatment etc TblCategory
Your other table, TblItems should have a foreign key field (CategoryID)
linking it to TblCategory (so that Access will know which are Security
Areas).
Create a query based on TblItems
Under CategoryID, in the Criteria row type
=Forms![FrmChoice]![cboCategory]
Base the other combo, cboItems, on this query.
In Form Design View, click on cboCategory. Click on the Properties button.
On the Events tab, click next to After Update and choose Event Procedure.
Click just right of that to open a code page
Above where it says
End Sub
type
Me.cboItems.Requery
(this ensures that each time you make a choice in cboCategory, cboItems
changes its filter).
If any of this is unclear, please write back.
Evi
T.Banks said:
Yes, I'm a newbie and I've been using the LookUp Fields in the table. I'm
unsure how to use a query or a form macro to do what I want. I simply want
to create a list that a user can choose from in one field and that will
produce a specific list out of many in the next field. If field one has a
lookup list box containing "Security", "Treatment", etc. I want the next
field to show only the [SecuirtyAreas] if "Security" was chosen .
[SecurityAreas] has a list of security areas the user can choose from. Being
new to Access I'm finding it hard to even pose a question that is easy to
understand. Thanks--
T.Banks
Evi said:
Do you mean that you want some code in your form to put those values into a
field? or do you mean that you want a combo box in your form or do you mean
that you want to write an IIF statement in a query?
Or do you mean that you want one combo box to change the choice of
selections in another one.
I suspect that you may be using Lookup fields in your tables to input data.
Fess up! is this true?
Evi
How do I make a drop down list that is dependent on the previous field.
Example:
If [Department]="Security" then [Area]=[SecuityLocations] or
If [Department]="Treatment" then [Area]=[TreatmentLocations]
[Department] field is a drop down list with "Security", "Treatment"
[SecurityLocations] field is a drop down list with "Units", "Isolation",
etc.
[TreatmentLocations] field is a drop down list with "Counselor's Office,
"Treatment Office", etc
[Area] field is the drop down showing either the [SecurityLocations] list
or
the [TreatmentLocations] list depending on what was chosen in the
[Department] list
-- Please help if this makes sense. Thanks/
T.Banks