B
benou
I have 2 tables
------------
table A
ProductA ValueA
a1 va1
a2 va2
a3 va3
------------
table B
ValueB ProductB
vb1 a1
vb2 a1
vb3 a2
vb4 a2
vb5 a3
vb6 a3
----------------------
tableB defines the possible values for ValueA based on matching ProductA and
ProductB
for example, if Product A = a1, the possible value for ValueA are vb1 and vb2
Now what I want to do is to see tableA in Datasheet view, and have a combo
box on ValueA where I can select the value for ValueA based on the value of
ProductA for that line, i.e. following the previous example, I would like to
be proposed vb1 or vb2 in the combo box.
So I figured out how to setup the combo box, but how do I setup my Row
Source for ValueA?
I've done
SELECT [tableB].[ValueB] From [tableB]
but this way, I get ALL the possible value for ValueB (and there are 15000
of them)
then I tried
SELECT [tableB].[ValueB] from [tableB] WHERE
[tableB].[ProductB]=[tableA].[ProductA]
it almost work... except that it's prompting me for ProductA once, and once
I entered a value, say a1, it will only give me the corresponding ValueB (vb1
and vb2). But it's not prompting me again.
So is there a way to specify something like: WHERE [tableB].[ProductB] =
thisline.[ProductA] ?
thanks,
Benoit
------------
table A
ProductA ValueA
a1 va1
a2 va2
a3 va3
------------
table B
ValueB ProductB
vb1 a1
vb2 a1
vb3 a2
vb4 a2
vb5 a3
vb6 a3
----------------------
tableB defines the possible values for ValueA based on matching ProductA and
ProductB
for example, if Product A = a1, the possible value for ValueA are vb1 and vb2
Now what I want to do is to see tableA in Datasheet view, and have a combo
box on ValueA where I can select the value for ValueA based on the value of
ProductA for that line, i.e. following the previous example, I would like to
be proposed vb1 or vb2 in the combo box.
So I figured out how to setup the combo box, but how do I setup my Row
Source for ValueA?
I've done
SELECT [tableB].[ValueB] From [tableB]
but this way, I get ALL the possible value for ValueB (and there are 15000
of them)
then I tried
SELECT [tableB].[ValueB] from [tableB] WHERE
[tableB].[ProductB]=[tableA].[ProductA]
it almost work... except that it's prompting me for ProductA once, and once
I entered a value, say a1, it will only give me the corresponding ValueB (vb1
and vb2). But it's not prompting me again.
So is there a way to specify something like: WHERE [tableB].[ProductB] =
thisline.[ProductA] ?
thanks,
Benoit