combo filtering

G

Guest

Hi

I have 2 tables.

1. Animal
2. AnimalChara

AnimalChara has 2 fields
Name and type like so

Name |Type
__________
|Cat| Purr|
|Cat| Meow|
|Cat| Catnip|
|Dog| bark|
|dog| Wag|
|Dog| Dog Toy|

the link between 1. and 2. is intermediate

what i would like to do is in Animal Table, in the field animal name i want
only cat and dog to come up ( i have done this by using an SQL "select
disctint name from animalChara" this is placed in the design view of the
table)

Now in the animal table in animal type field i want only either when dog or
cat is selected only it's "aninal types" from animalchara table comes up.
 
G

Guest

Hi thanks for your response

However i would prefer a sql statement instead

as i have the first working already all i need is that statement elimenates
all other field once selected at table level design

Thanks

Again
 
S

SusanV

In the first field's after update event, change the source of the second box
to apply the filter and refresh the form:

Dim strAnimal as String
strAnimal = Me.FirstBox
Me.SecondBox.RowSource = SELECT [Type] FROM AnimalChara WHERE Animal = '" &
strAnimal & "'"


Change your control names as required.
 
G

Guest

I'm trying to use the SQL builder (table - design view - field name - lookup
row source)

I would like a sql statement

combo1 already has = select disctint name from animalChara
combo2 need another sql statement that filters out once combo1 has selected


I know i am being a pain :> sorry


SusanV said:
In the first field's after update event, change the source of the second box
to apply the filter and refresh the form:

Dim strAnimal as String
strAnimal = Me.FirstBox
Me.SecondBox.RowSource = SELECT [Type] FROM AnimalChara WHERE Animal = '" &
strAnimal & "'"


Change your control names as required.
--
hth,
SusanV



BV said:
Hi thanks for your response

However i would prefer a sql statement instead

as i have the first working already all i need is that statement
elimenates
all other field once selected at table level design

Thanks

Again
 
S

SusanV

Sorry but I've never used the SQL builder...

:-/

Basically combo2 needs the where clause to be based on combo1's value...
which isn't a really defined until the user selects something in combo1, no?
In which case you need to use the after_update event of combo1... Unless I'm
even more confused than you are <grin>

<singing> Here we go round in circles!

Not trying to be sarcastic, I'm just not sure you can accomplish what you
need using the builder, as I'm not familiar with that tool.
--
SusanV


BV said:
I'm trying to use the SQL builder (table - design view - field name -
lookup
row source)

I would like a sql statement

combo1 already has = select disctint name from animalChara
combo2 need another sql statement that filters out once combo1 has
selected


I know i am being a pain :> sorry


SusanV said:
In the first field's after update event, change the source of the second
box
to apply the filter and refresh the form:

Dim strAnimal as String
strAnimal = Me.FirstBox
Me.SecondBox.RowSource = SELECT [Type] FROM AnimalChara WHERE Animal = '"
&
strAnimal & "'"


Change your control names as required.
--
hth,
SusanV



BV said:
Hi thanks for your response

However i would prefer a sql statement instead

as i have the first working already all i need is that statement
elimenates
all other field once selected at table level design

Thanks

Again

:

Hi BV,

Sounds like what you're looking for is Cascading list or comboboxes -
what's
in the first list determines what's available in the second list,
which
(possibly) determines what's available in the third etc. This page
should
help you set this up:
http://www.fontstuff.com/access/acctut10.htm

--
hth,
SusanV


Hi

I have 2 tables.

1. Animal
2. AnimalChara

AnimalChara has 2 fields
Name and type like so

Name |Type
__________
|Cat| Purr|
|Cat| Meow|
|Cat| Catnip|
|Dog| bark|
|dog| Wag|
|Dog| Dog Toy|

the link between 1. and 2. is intermediate

what i would like to do is in Animal Table, in the field animal name
i
want
only cat and dog to come up ( i have done this by using an SQL
"select
disctint name from animalChara" this is placed in the design view of
the
table)

Now in the animal table in animal type field i want only either when
dog
or
cat is selected only it's "aninal types" from animalchara table
comes
up.
 
G

Guest

LOL at singing!!

I know what you mean, i appraicaite your help too, i would be also grateful
if you could point me to the right person that could help me... or send the
person this post.

again thanks (have fun singing!)

Regards

SusanV said:
Sorry but I've never used the SQL builder...

:-/

Basically combo2 needs the where clause to be based on combo1's value...
which isn't a really defined until the user selects something in combo1, no?
In which case you need to use the after_update event of combo1... Unless I'm
even more confused than you are <grin>

<singing> Here we go round in circles!

Not trying to be sarcastic, I'm just not sure you can accomplish what you
need using the builder, as I'm not familiar with that tool.
--
SusanV


BV said:
I'm trying to use the SQL builder (table - design view - field name -
lookup
row source)

I would like a sql statement

combo1 already has = select disctint name from animalChara
combo2 need another sql statement that filters out once combo1 has
selected


I know i am being a pain :> sorry


SusanV said:
In the first field's after update event, change the source of the second
box
to apply the filter and refresh the form:

Dim strAnimal as String
strAnimal = Me.FirstBox
Me.SecondBox.RowSource = SELECT [Type] FROM AnimalChara WHERE Animal = '"
&
strAnimal & "'"


Change your control names as required.
--
hth,
SusanV



Hi thanks for your response

However i would prefer a sql statement instead

as i have the first working already all i need is that statement
elimenates
all other field once selected at table level design

Thanks

Again

:

Hi BV,

Sounds like what you're looking for is Cascading list or comboboxes -
what's
in the first list determines what's available in the second list,
which
(possibly) determines what's available in the third etc. This page
should
help you set this up:
http://www.fontstuff.com/access/acctut10.htm

--
hth,
SusanV


Hi

I have 2 tables.

1. Animal
2. AnimalChara

AnimalChara has 2 fields
Name and type like so

Name |Type
__________
|Cat| Purr|
|Cat| Meow|
|Cat| Catnip|
|Dog| bark|
|dog| Wag|
|Dog| Dog Toy|

the link between 1. and 2. is intermediate

what i would like to do is in Animal Table, in the field animal name
i
want
only cat and dog to come up ( i have done this by using an SQL
"select
disctint name from animalChara" this is placed in the design view of
the
table)

Now in the animal table in animal type field i want only either when
dog
or
cat is selected only it's "aninal types" from animalchara table
comes
up.
 
S

SusanV

Perhaps someone else will pipe in with help on the builder - or you could
take a moment to read the link I originally sent, as I'm certain you can
easily accomplish what you need with this method.

In the mean time, good luck!
<singing> Happy trails to you...

<grin>

SusanV

BV said:
LOL at singing!!

I know what you mean, i appraicaite your help too, i would be also
grateful
if you could point me to the right person that could help me... or send
the
person this post.

again thanks (have fun singing!)

Regards

SusanV said:
Sorry but I've never used the SQL builder...

:-/

Basically combo2 needs the where clause to be based on combo1's value...
which isn't a really defined until the user selects something in combo1,
no?
In which case you need to use the after_update event of combo1... Unless
I'm
even more confused than you are <grin>

<singing> Here we go round in circles!

Not trying to be sarcastic, I'm just not sure you can accomplish what you
need using the builder, as I'm not familiar with that tool.
--
SusanV


BV said:
I'm trying to use the SQL builder (table - design view - field name -
lookup
row source)

I would like a sql statement

combo1 already has = select disctint name from animalChara
combo2 need another sql statement that filters out once combo1 has
selected


I know i am being a pain :> sorry


:

In the first field's after update event, change the source of the
second
box
to apply the filter and refresh the form:

Dim strAnimal as String
strAnimal = Me.FirstBox
Me.SecondBox.RowSource = SELECT [Type] FROM AnimalChara WHERE Animal =
'"
&
strAnimal & "'"


Change your control names as required.
--
hth,
SusanV



Hi thanks for your response

However i would prefer a sql statement instead

as i have the first working already all i need is that statement
elimenates
all other field once selected at table level design

Thanks

Again

:

Hi BV,

Sounds like what you're looking for is Cascading list or
comboboxes -
what's
in the first list determines what's available in the second list,
which
(possibly) determines what's available in the third etc. This page
should
help you set this up:
http://www.fontstuff.com/access/acctut10.htm

--
hth,
SusanV


Hi

I have 2 tables.

1. Animal
2. AnimalChara

AnimalChara has 2 fields
Name and type like so

Name |Type
__________
|Cat| Purr|
|Cat| Meow|
|Cat| Catnip|
|Dog| bark|
|dog| Wag|
|Dog| Dog Toy|

the link between 1. and 2. is intermediate

what i would like to do is in Animal Table, in the field animal
name
i
want
only cat and dog to come up ( i have done this by using an SQL
"select
disctint name from animalChara" this is placed in the design view
of
the
table)

Now in the animal table in animal type field i want only either
when
dog
or
cat is selected only it's "aninal types" from animalchara table
comes
up.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top