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
2 1169
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?"
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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,
email char,
|
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 then modify it). I have
tried all sorts of variations on:
INSERT INTO emaillist SELECT * FROM emaillist WHERE emailid = #url.emailid#
(inc trying IGNORE) but of course this throws an error over duplicate keys.
All I want to do is to take...
|
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.
Private Sub Command1_Click()
Dim MyDb As DAO.Database, MyRs As DAO.Recordset
Dim strCode As String
Dim strFilter As String
Set MyDb = CurrentDb
|
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 invoice no (both Primary
& secondary) into a new invoice no.
can some one help me in this?
|
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. Currently I am
already doing something similar by copying certain records into the
same table. The only thing that changes is one field.
Please look at the code:
Dim MyDb As DAO.Database, MyRs As DAO.Recordset
Dim strCode As String
| |
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 products).
Tables:
tblCategoryDetails
CategoryID
SpecID
|
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 "duplicate" button. It copies the
main form data, the subform data and moves to the new record. Great!
Here's the problem...if I move to another record (or stay on the newly
created record, for that matter), and hit the Duplicate button...
|
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 be copied and duplicated back in the original underlying table for that subform.
To give a bit more background, the main form contains records of individual ‘reports’ (held in table called CPG1) and the subform (CPG3_Subform) identifies the...
|
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 being filled out the next month. i thought of putting the controls i want to duplicate in a label, but the text is too much and i can't scroll with a label control, so had to use a text/ memo box. is there a way i can click a button and the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |