L
Lance McGonigal
Hi all...Thanks in advance for your assistance.
I have a table of codes (A1):
Rep;Code; Amount
01;A; 1.00
02;B; 2.00
01;B; 2.00
etc
And a table (B2) for consolidation of values
Rep;A;B;etc
01;0;0
02;0;0
Is there any way I can reference the correct field in B2 using a the code
from A1. I know this won't work but here is some sample code:
set a = currentdb.openrecordset("A1")
set b = currendb.openrecordset("B2")
do while not a.eof
b2.findfirst "[repno] = '" & a!repno & "'"
MyField = "B2![" & a!code & "]"
a.edit
Myfield = MyField + a!amount
a.update
a.movenext
loop
I know this is silly and a poor design but it's what the customer wants and
it's the least amount of maintenance (if it can be done) that I can think
of.
Thanks again.
I have a table of codes (A1):
Rep;Code; Amount
01;A; 1.00
02;B; 2.00
01;B; 2.00
etc
And a table (B2) for consolidation of values
Rep;A;B;etc
01;0;0
02;0;0
Is there any way I can reference the correct field in B2 using a the code
from A1. I know this won't work but here is some sample code:
set a = currentdb.openrecordset("A1")
set b = currendb.openrecordset("B2")
do while not a.eof
b2.findfirst "[repno] = '" & a!repno & "'"
MyField = "B2![" & a!code & "]"
a.edit
Myfield = MyField + a!amount
a.update
a.movenext
loop
I know this is silly and a poor design but it's what the customer wants and
it's the least amount of maintenance (if it can be done) that I can think
of.
Thanks again.