S
Sue M.
Hi,
I've imported an invoice from excel into an Access table, tblInvoice. The
table has an ID number column.
I need to figure out how to "copy down" the PO number so it is on every
detail line below it.
Because this is supposed to be a macro to use over and over again, it would
be really great
if it could be automatic. I think it can be done but I don't know how. I
looked into cartesian products
and making some kind of temp table but none of the results of my ideas look
close...
So far my macro empties the tblInvoice table, resets the ID field to 1,
imports the new file and appends it to the tblInvoice table.
For the rows where the PO number is, F1 says "PO No." and F2 has the actual
number I want: "1234A".
I made a new column in tblInvoice, PO_NO to fill in.
SELECT [tblInvoice].ID, [tblInvoice].F1, [tblInvoice].F2
FROM [tblInvoice]
WHERE ((([tblInvoice].F1)="PO NO."));
returns
ID F2
7 4572B
32 3829D
46 5801A
68 4968B
70 5812A
Now I can't figure out in what way to update tblInvoice.PO_NO to "4572B"
where ID is between 7 and 31,
and "3829D" ... between 32 and 45, etc. And "5812A" between 70 and whatever
the last number is.
Please let me know even if this is impossible. Any clue is appreciated!
Thanks!
Sue
I've imported an invoice from excel into an Access table, tblInvoice. The
table has an ID number column.
I need to figure out how to "copy down" the PO number so it is on every
detail line below it.
Because this is supposed to be a macro to use over and over again, it would
be really great
if it could be automatic. I think it can be done but I don't know how. I
looked into cartesian products
and making some kind of temp table but none of the results of my ideas look
close...
So far my macro empties the tblInvoice table, resets the ID field to 1,
imports the new file and appends it to the tblInvoice table.
For the rows where the PO number is, F1 says "PO No." and F2 has the actual
number I want: "1234A".
I made a new column in tblInvoice, PO_NO to fill in.
SELECT [tblInvoice].ID, [tblInvoice].F1, [tblInvoice].F2
FROM [tblInvoice]
WHERE ((([tblInvoice].F1)="PO NO."));
returns
ID F2
7 4572B
32 3829D
46 5801A
68 4968B
70 5812A
Now I can't figure out in what way to update tblInvoice.PO_NO to "4572B"
where ID is between 7 and 31,
and "3829D" ... between 32 and 45, etc. And "5812A" between 70 and whatever
the last number is.
Please let me know even if this is impossible. Any clue is appreciated!
Thanks!
Sue