Thanks again - you wouldn't happen to be near Little Rock, AR would you? I
think I owe you lunch.
:
SELECT DISTINCT [LOB] FROM [TBL V-L-A Data] WHERE [Vertical]= cboVertical;
will return one item for each value regardless of the number of times the
value occurs in the table.
(There are a few dents in my wall, too
:
One other thing, if you have a second - how do I filter these results to
distinct records? (i.e. there are many instances of each Vertical, etc. in
the table - the only field that is always unique is project name.). Thanks
again - this is going to save me a LOT of time.
:
Darn it!
I forgot. When used like this, the Me. is not understood. You can do
either
SELECT [LOB] FROM [TBL V-L-A Data] WHERE [Vertical]= cboVertical;
or
SELECT [LOB] FROM [TBL V-L-A Data] WHERE [Vertical]=
Forms!MyFormName!cboVertical;
Sorry about that.
:
The row source for Vertical is TBL V-L-A Data
The row source for LOB is SELECT [LOB] FROM [TBL V-L-A Data] WHERE
[Vertical]=Me.cboVertical;
The row source for Application is SELECT [Application] FROM [TBL V-L-A Data]
WHERE [LOB]=Me.cboLOB;
That's as far as I've taken it - once those three work, then I can get the
rest.
Thanks again!
:
I should have been more clear. I need to see the Row source code for all the
combos.
:
All of the fields are text fields.
Code (I'm assuming you mean the event procedure) is:
---------------------
Private Sub Vertical_AfterUpdate()
Me.LOB.Requery
End Sub
----------------------------
Similarly set up for the other fields.
Thanks... I know it's not easy answering questions like this without having
the database in front of you.
:
Post your code, please. Also include the data type for each field in the
table.
:
When I follow your procedure, it asks me to retype my selection when I go to
the next box (e.g - when I select a Vertical, and then go to the LOB field,
it asks me for my Vertical selection again. If I type it in the dialogue box,
it brings me the correct list - but if I don't type it correctly or just hit
OK it returns no responses). It then lets me select an LOB - but when I do,
it takes me to a compile error and says that .requery "Method or Data Entry
no found". Is there something else I need to add?
Thanks so much for your help. If I can get this to cooperate, then some of
my other problems will go away as well.
:
That is because you are not using good naming practices. Best naming rule:
Use only letters, digits, and the underscore _
Never use spaces, special characters or reserved words.
When you use non standard naming, it is necessary to enclose the name in
brackets. You can even do it when good naming is used for clarity
SELECT [LOB] FROM [TBL V-L-A Data] WHERE [Vertical] = Me.cboVertical;
:
I've tried putting the Me.cboLOB.Requery in the After Update, and it seems to
be OK, but I'm not sure how to filter the way that you are describing. I've
tried putting SELECT LOB FROM TBL V-L-A Data WHERE Vertical = Me.cboVertical;
but it keeps coming back with an error - "Syntax Error in Query - incomplete
query clause". Am I putting this in the wrong place? I'm putting that
argument in the Row Source box for the combo box, and I've chosen Table/Query
as the Row Source Type. Thanks - I've got five or six other problems I'm
trying to solve, and I'm a bit overwhelmed.
:
This is a pretty simple process once you grasp the concept. Each combo's row
source has to be filtered on the previous combo's value. For example, the
LOB combo's row source needs to filter on the value in the Vertical combo:
SELECT LOB FROM MyTable Name WHERE Vertical = Me.cboVertical;
And so on.
Then in the After Update event of each combo, you requery the next combo:
Private Sub cboVertical_AfterUpdate()
Me.cboLOB.Requery
:
I'm working way above my skill level on this project, so I hope this is an
easy one.
I've got a form - FRM_Projects - that includes four combo boxes that need to
cascade. The table has four columns (Vertical, LOB, Application and Project
Name) that correspond to each of the four combo boxes. I need to set it up so
that when you select the Vertical for the project, the LOB box will display
only the LOB records that relate to the Vertical selected, and then when the
LOB is selected that it will only show the Application records that relate to
the LOB and the Vertical selected. There are duplicate records in each column
but the Project name, of course (there are 4 Vertical choices, and 12 LOB
choices, etc.). I am very unfamiliar with VB scripting and have been a
poweruser but not a developer for Access in the past - can someone help,
please? Thanks so much!!