473,513 Members | 2,684 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Duplicating records

2 New Member
My problem is this, I can set up a command button to duplicate a record everytime I click on it. What happens is that I get a record but it will be at the end of the table. For example, if I am on record 5 of 10 records and I click on my button I get a new record as number 11, I want the record to be number 6, inserted after the record I click on. I need to have the records in order because the next step is to generate a new number for the new records, in order. I have not gotten that far. Any help?

thanks
May 14 '07 #1
2 1164
missinglinq
3,532 Recognized Expert Specialist
First off, a new record will always be added to the end of the table, and thus if you have 10 records and add one, it will be #11. Depending on how the underlying query is sorted, doing a requery of the form may or may not place the new record next after the copied record in the form. But it's position in the table will still be #11.

because the next step is to generate a new number for the new records, in order
How are you generating the "new number?"
May 15 '07 #2
kkiger
2 New Member
First off, a new record will always be added to the end of the table, and thus if you have 10 records and add one, it will be #11. Depending on how the underlying query is sorted, doing a requery of the form may or may not place the new record next after the copied record in the form. But it's position in the table will still be #11.

How are you generating the "new number?"
First of all, thank for your help. What I have is a table and form1. Form1 will have only a few of the fields in the table and group1 will fill out form1. Later group2 will call up form2. Form2 will have the fields that group1 filled out and group2 will finish filling out the form2. In most cases when group2 fills out form2 they will hit a button and the next 'analysis number' will be generated and put into the proper field. In some cases group2 will need to generate duplicates copies of the record and then generate 'analysis numbers' for each record. For example: record 10 is on the screen, group2 duplicates this record twice. Record 10 is still on the screen and group2 generates a number, say 5000. They would need to then go to the two newly duplicated records, at the end of the table, and generate 5001 and 5002. I hope this makes sense and you can help.

Thanks
May 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1311
by: Karam Chand | last post by:
Greetings I manage a website wherein i keep track of the people email who have downloaded my software and the version number. the structure is like - id int auto_increment primary key,...
4
1531
by: Jon Cooper | last post by:
I have looked long n hard at the Insert Select as being the answer to my need to create duplicate records. (Purpose is basically to allow someone to create a duplicate of an existing email template...
0
380
by: Paolo | last post by:
I know I should not be doing this but I find it very useful. I have this code that duplicates some records in a table named CLIENTS.I use a form named CLIENTS to add data to this table. ...
1
367
by: pwys | last post by:
Hello to everyone WOndering if there anyone could help me with this. I have a Primary & a secondary table with the unique key (InvoiceNo) Waht i want is to make duplicate copy of a selected...
7
2083
by: Paolo | last post by:
I know I should not be doing this, but I find it very useful. I have a database in Access which stores data for a small company. Sometimes we need to add similar information to different tables....
6
2496
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
8
5749
by: Josetta | last post by:
I have found a wealth of information here on how to duplicate records in forms with subforms. I have adapted code found here to work with my forms. It works beautifully the first time I hit the...
7
2040
by: Albennett | last post by:
Hello. I’m new to writing VBA code but getting there thanks, for the most part, to the excellent advice on this site. I trying to create the code which will allow all records from a subform to...
2
1252
by: zandiT | last post by:
hello i created a database that has a form which represents a template. this template is filled out every month. my problem is i don't want to have to copy and paste ever record wen the template is...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.