Inserting last auto-generated ids

Vbanoob98

Board Regular
Joined
Sep 13, 2019
Messages
128
I have a linked table from excel which I refresh every month and export the data to another Access table. This table generates an autoid for each row which I copy and then paste back into the excel. After this I export the data with the ID to another Access table.

I was wondering if there was a way to autmate this to reduce user error. Thanks a lot

Excel linked table-->access table 1 (generates ID)--->back to excel linked table-->access table 2
 
Yes thats very useful. How can I do this for lets say 200 rows instead of just 1? Or will this do it for all the rows?

And how could I join the result to my other table? :)
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Possibly you are looking for something like this if you want to join two tables - where Table2 has the ID

Code:
select t2.ID, t1.Name, t1.Amount, t1.Address, t1,Total
 from Table1 t1
 inner join Table2 t2
on t1.Name = t2.Name
and t1.Amount = t2.Amount
and t1.Address = t2.Address
and t1.Total = t2.Total
 
Upvote 0
Possibly you are looking for something like this if you want to join two tables - where Table2 has the ID

Code:
select t2.ID, t1.Name, t1.Amount, t1.Address, t1,Total
from Table1 t1
inner join Table2 t2
on t1.Name = t2.Name
and t1.Amount = t2.Amount
and t1.Address = t2.Address
and t1.Total = t2.Total

Thank you, I will try this tomorrow.
 
Upvote 0
Possibly you are looking for something like this if you want to join two tables - where Table2 has the ID

Code:
select t2.ID, t1.Name, t1.Amount, t1.Address, t1,Total
from Table1 t1
inner join Table2 t2
on t1.Name = t2.Name
and t1.Amount = t2.Amount
and t1.Address = t2.Address
and t1.Total = t2.Total

I've been playing with this and it seems it requieres a unique identifier to work properly? Because when I put all the fields it just returns the headers.
 
Upvote 0
When you say it just returns the headers that means that the query resulted in no records (an empty set). That suggests that there is no match on the join criteria. You may need to examine one or two examples you think should be in the result and work out why they were excluded based on the join criteria. I'm doing a lot of guessing about your data - not able to say anything specific without an some sample data.
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,802
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top