Two simple questions:
- How to copy table after update (docmd.object copy)?
- How to do this after the table is updated trought form?
And becouse I'm dumbass I need code for this
TY
Two simple questions:
- How to copy table after update (docmd.object copy)?
- How to do this after the table is updated trought form?
And becouse I'm dumbass I need code for this
TY
To where do you wan to copy the object?
I am really curious, why do you need to copy a table? This is not normally done in production.
Boyd Trimmell aka Hitechcoach
Database Architect and Problem Solver
Microsoft MVP - Access Expert
25+ years specializing in Accounting, Inventory, and CRM systems
"If technology doesn't work for people, then it doesn't work."
To same database. I have problem with db, becouse i need identical data in this table but the other data is different.
Same customer have separated bills.
This thread explains my idea
https://www.accessforums.net/forms/i...ata-11851.html
OK, i'll try to explain.
I need separate subdatabase.
Same structure, same (customers) but other tables (same data type) but other data.
1. Customer - Bill - Items (custom items)
2. Customer (same as above) - Bill (new ID, from zero) - Item (ONE item)
Simply I want practically the same database without entering same CUSTOMERS in second thable.
I agree with Adam that probably really have no need to duplicate the tables.
What you are wanting to do it normally done in spreadsheets. It is not done in relational databases. It would defeat the purpose of a well designed relational database. When table structure are the same then they should be in the same table. The data does not matter. The data could be for one customer to 100,000+ customers, it will still be in the same table if the table structures would be basically identical. If you want it to appear as multiple tables to the end user then you use queries to filter the data. It can appear to the end user that there are many tables, but in reality it is just one.
If it were mine, I would avoid copying tables. It can get really messy really fast once you start. If your really decide to go against the wisdom of the Database Masters and still do it, make sure you do a backup or two before you run the copy table routine. Don't forget you will need to write VBA code to create all the relationship to enforce referential integrity.
Boyd Trimmell aka Hitechcoach
Database Architect and Problem Solver
Microsoft MVP - Access Expert
25+ years specializing in Accounting, Inventory, and CRM systems
"If technology doesn't work for people, then it doesn't work."
With my current knowledge it mission imposible, also i would have ~100 users (not big deal).I agree with Adam that probably really have no need to duplicate the tables.
What you are wanting to do it normally done in spreadsheets. It is not done in relational databases. It would defeat the purpose of a well designed relational database. When table structure are the same then they should be in the same table. The data does not matter. The data could be for one customer to 100,000+ customers, it will still be in the same table if the table structures would be basically identical. If you want it to appear as multiple tables to the end user then you use queries to filter the data. It can appear to the end user that there are many tables, but in reality it is just one.
If it were mine, I would avoid copying tables. It can get really messy really fast once you start. If your really decide to go against the wisdom of the Database Masters and still do it, make sure you do a backup or two before you run the copy table routine. Don't forget you will need to write VBA code to create all the relationship to enforce referential integrity.
If anyone can simply write few lines it'll make my life better
I've got no time left, so any simple solution will be ok.
This is my DB attached, so feel free to recommend a solution.
After looking at your attachment I recogize this database from the same question in your other post HERE
I would just add an additional field to the table Artikli to idenfity the group/category or whatever you want to call it. This new field would contain data like usluge.
Boyd Trimmell aka Hitechcoach
Database Architect and Problem Solver
Microsoft MVP - Access Expert
25+ years specializing in Accounting, Inventory, and CRM systems
"If technology doesn't work for people, then it doesn't work."
OK, if i add this additional field, will i have new RAČUN from zero. Becouse i want this (if i didn't explain this).After looking at your attachment I recogize this database from the same question in your other post HERE
I would just add an additional field to the table Artikli to idenfity the group/category or whatever you want to call it. This new field would contain data like usluge.
User 1 - Račun 1 - Stavka 1,2,3,4....
User 1 - Račun 1 / usluga - Stavka 1 (usluga)
User 1 - Račun 2 - Stavke 2,34,5,...
User 1 - Račun 2 / Usluga - Stavka 1 (usluga)
That mean different form for USLUGE, (different contorl source for ARTIKLI), and RAČUN must have ID increment. With your solutuion i have RAČUN & RAČUN USLUGE with different ID or?
I am not understnd what you are needing or doing.
From the best I can figure out it seams like you may be needing a custom auto incrementing field. You can use DMax() +1 to calculate the next number.
Boyd Trimmell aka Hitechcoach
Database Architect and Problem Solver
Microsoft MVP - Access Expert
25+ years specializing in Accounting, Inventory, and CRM systems
"If technology doesn't work for people, then it doesn't work."
And there is problem again. How to change this DMax () + 1.
And also (i left some test data in db), how to change ID of RAČUN when is one/more record deleted (also in ARTIKLI/KORISNICI). For example, i have 3 users User 1, User 2, User 3, and i delete User 2, new next user is User 4 (how to add this new to 2, or simply how to User 3 marge to User 2.
EDIT:
How to simply have 2 subdatabases:
1. Korisnici - Račun - Stavke - Artikli
2. Korisnici_us - Račun_us - Savke_us - Artikli_us
Where Korisnici & Korisnici_us are the same, i.e. Korisnici FORM update Korisnici and Korisnici_us tables?
Will all users need access to the same backend?
Maybe you need to give each user their own separate back end?
If you have not split your database then see there articles on Split Database (Click Here)
Boyd Trimmell aka Hitechcoach
Database Architect and Problem Solver
Microsoft MVP - Access Expert
25+ years specializing in Accounting, Inventory, and CRM systems
"If technology doesn't work for people, then it doesn't work."
Not Users as Users, it'll be one Admin/User. By users i meant, users as data in table sorry.Will all users need access to the same backend?
Maybe you need to give each user their own separate back end?
If you have not split your database then see there articles on Split Database (Click Here)
Since I don't have a clue about what your datasbes is trying to do I don't don't know how to help you do this proeprly.
If you actaully have ~100 user then you would need to copy the set of tables ~100 times. If you cwna to copy the table then I would look inot separate back ends. I still thin kthe correct solutuion is using a single set of tables.
Boyd Trimmell aka Hitechcoach
Database Architect and Problem Solver
Microsoft MVP - Access Expert
25+ years specializing in Accounting, Inventory, and CRM systems
"If technology doesn't work for people, then it doesn't work."
If you really want to copy the tables then I woudl use DAO code to create each new set of tables and create the correct relationshsips. See: DAO Programming Code Examples
Boyd Trimmell aka Hitechcoach
Database Architect and Problem Solver
Microsoft MVP - Access Expert
25+ years specializing in Accounting, Inventory, and CRM systems
"If technology doesn't work for people, then it doesn't work."