Create copy of a table in Access VBA

learningthings

New Member
Joined
Oct 29, 2021
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I have frmEmployees where you enter the name of the employee txtEmployeeName
When you click the save button, cmdSave I want access to create a new table with the name: Transaction(employeename) which is a copy of the original table Transaction
I only want the structure to be copied, not the content
For example for an employee name megan the new table would be TransactionMegan
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Sounds like a very terrible, terrible idea? :(
Perhaps review 'normalization' ?
 
Upvote 0
Yeah, creating a separate table for each person usually isn't good database design. If you wanted to query the data, you would separate queries for each table.
Generally, if you have multiple tables with the exact same structure, that is often a sign of a database that has not been designed well.
What reason do you have for doing this?
Perhaps if we understand why you are doing this, we can offer alternative suggestions that will allow you to have a "normalized" database, which will make it easier to work with.
 
Upvote 0

Forum statistics

Threads
1,224,906
Messages
6,181,666
Members
453,059
Latest member
jkevin

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