What's The Best Method Of Duplicating A Record?
Feb 22, 2005
Hi,
I want to be able to make an exact copy of an existing record in a table and then change the value of a couple of the fields before writing it to the table as a new record.
What is the best way to go about this? I guess it is possible with select, update and append queries but I'd rather do it in code.
It sounds like it should be a simple and commonly performed exercise but I can't find anything on it.
Thanks in advance!
John
View Replies
ADVERTISEMENT
Feb 10, 2008
Hi
I'm hoping this is quite easy as I'm new to Access.
I have a record similar to the below
recordID: 1
animals: cats
breed: persian
number: 3
price: £50 each
What I would like to do is dupicate the above data three times, changing the field in "number" to show as 1 on each occassion...so, theoretically, the data will be exactly the same in each new record except for recordID....
e.g
recordID: 2
animals: cats
breed: persian
number: 1
price: £50 each
recordID: 3
animals: cats
breed: persian
number: 1
price: £50 each
recordID: 4
animals: cats
breed: persian
number: 1
price: £50 each
Can anyone tell me how to do this?
Many thanks, Tim
View 1 Replies
View Related
Dec 4, 2007
I have a table that contains financial data on projects. Each project has one record consisting of numerous fields.
I want users to be able to archive off copies of these records at certain points in time so I can track the financial data - a bit like storing different versions or issues.
On any one day I want users to be able to access the live record and review the archive.
Question : Is there a simple way of duplicating a record in a table ?
At the moment I am using a form by copying all of the field values from this form, moving to a new record, writing the field values back to the form hence creating a copy. This seems somewhat laborious.
Can't I access the table directly somehow and simply cut and paste ?
Also, is there a simple way to check for a duplicate record before cloning the record i.e. if the data has already been archived once don't do it again.
View 4 Replies
View Related
Jan 25, 2005
Ok I haven't worked on access for a while and so my knowledge of my own database is a little poor. But I have a button on one of my forms which duplicates records. The problem is, not only does it duplicate the record but it also creates a blank record. Is there something i can put in the command for the button that will delete records that are completely null?
Many fields of other records are also null so I only want to delete records that have null in all their fields, or better yet just stop creating these blank records.
Hopefully that makes sense to someone,
Wee
View 1 Replies
View Related
Mar 8, 2006
I have a form with a job number textbox. I want to be able to edit the current record on screen by changing the job number and then save (duplicate) the record i.e. create a new record with the new job number without saving the old record I was editing. How do I do this? I tried the duplicate record command button but it saves the old record with the changed job number as well as duplicating it. :confused:
View 3 Replies
View Related
Dec 1, 2014
I created a button in a form that duplicates the record so our employees can fill in the form more quickly.
I know I am being greedy, but is there someway to change the VBC so I only duplicate certain fields in a record, not all of them?
I have attached a (.jpg) of the Duplicate record code that is automatically created by Access when you use the "Duplicate record" option when making up a button on a form. I have attached a 2nd (.jpg) which shows the (7) fields I want to duplicate, out of the (20) available fields for each record.
View 9 Replies
View Related
Mar 28, 2015
Is it possible to duplicate a record with selected fields, to be copied into a new record. ie if there are 10 fields, i only need 8 of them (no need for timestamp field etc form existing record).
View 1 Replies
View Related
Jul 31, 2005
Help!!!
I am setting up a database with 'open' and 'close' dates of an event for each record/ID. I want to be able to sort/query my results into the next event (i.e. open or close) as it will be happening so that I can plan for each event, but I am not sure how to go about doing this. I have tried various queries but because the information is linked to one ID it does not want to duplicate the information in the record. I can set up separate queries for the 'open' and 'close' dates but I can't seem to be able to tie it together
=>I have 2 queries, but I really need it to be at least in one report in date order each record appearing twice ...once at the open date, once at the closing date.
anyone....please!!!!!!!
:) thank u
View 2 Replies
View Related
May 23, 2015
I am wanting to create a new record in a table copying the majority of the data from another record in the table. I am using the following code which creates new records but the data isn't being copied.
This is the section of code:-
' Return Control object variable pointing to list box.
Set ctlList = Me!lbStudents
' Enumerate through selected items.
For Each varItem In ctlList.ItemsSelected
' Get the info to get the enrolment record
intClientID = Me.lbStudents.Column(7, varItem)
[Code]...
what I'm doing wrong?
View 2 Replies
View Related
May 17, 2014
In my database scenario, a patient would see a doctor and the doctor would check off fields in a form representing different disease symptoms that the patient has to calculate a final score (for ex. if the patient has 2 symptoms, the final score would be 2).
After a few months, the patient would visit the doctor again, and the doctor will have to fill out the same form, adding any new symptoms the patient might now have. I would like to have the disease symptom fields checked off in the previous visit automatically show up in the new form, so that the doctor only has to add the new symptoms, and then recalculate the score using both the old and new data (for ex., if the patient had 2 symptoms before and 3 more symptoms now, the score would be 5).
View 2 Replies
View Related
Aug 7, 2014
I have a navigation form that has a tabbed form on one of its tabs. The tabbed form has a 'current client' query record source and allows one to choose from a list of current clients and when a client is selected - details relating to client are displayed on various tabs on tabbed form.
I want to duplicate tabbed form and change record source to a query selecting 'exited clients' so I can see same information but for exited clients.
I have created a new tab on navigation form for my new exited clients tabbed form and changed record source by creating a new exited client query but when I change record source on exited client tabbed form it automatically changes record source of current client tabbed form to the exited client query and visa versa.
View 3 Replies
View Related
Feb 25, 2014
I have a form with a duplicate record button.Sometimes when duplicating a record the duplicate is created but the form remains in edit mode (small pencil in the form margin).I also have a manual record counter on the form which does not refresh to the newest record number following the duplication? Both issues happen together and not independently.
I now have the standard MS Access record counter visible on the form to see whats happening and this always jumps correctly to a new record number when duplication is triggered, so when the problem happens the MS Access counter is showing one more than my own record counter.
If I use the standard MS Access record navigation buttons and go back and then forward by one record, the duplicated record is then corrected. The edit mode pencil is gone and both record counters read the same, which I assume has happened this has forced a save to happen
If Me.Dirty
Then Me.Dirty = False
End If
- in the current event of the form, would solve the problem, but it doesnt make any difference at all, its still no better, or no worse than before?Using CTRL + S removes the pencil, but doesn't correct my bespoke record counter?
View 6 Replies
View Related
Feb 11, 2014
My question is which method of finding the last record is best, QueryDef or Recordset? Here is my data:
Table:
tbl_module_repairs
Field:
aps_rma
Textbox to insert last record RMA into:
txt_test
Here is some code I tried but get an invalid argument msgbox:
'''''''''''''''''''''''''''''''''
'Opens last RMA into textbox (For opening tag sheet)
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
'Get the database and Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tbl_module_repairs")
[Code] .....
View 14 Replies
View Related
Mar 8, 2014
I am trying to locate a record on a multirecord form by using Findfirst method. Here is the code.
Dim UA1 As String, UAE1 As String, UA2 As String, UAE2 As String, UA3 As String, UAE3 As String, apost as string, repl as string
apost = "'"
repl = "''"
UA1 = Nz(Forms(ParName).Form.NAME, " ")
UAE1 = Replace(UA1, apost, repl)
[Code] ....
This code sometimes works and sometimes it does not work. The field CNO is a text field of 5 characters but contains the card numbers that is numeric data or nothing.
View 2 Replies
View Related
Nov 25, 2005
Hi
Please can some help me asap. I need to do a querie which joins two tables together. I have a telemarketing table and an appointment table. The idea is that when an appointment is made telemarketing should be done afterwards to the same company. Therefore I want to view all of the telemarketing done and all of the appointments done and then match companies which have had both an appointment and telemarketing. However when i do this if there has been more appointments made for one company that there has been telemarketing the telemarketing duplicates itself so that the two have the same amount done which is not what I want??? Does this make sense?? Can some one please help????
Thanks
View 5 Replies
View Related
Jul 4, 2007
Hi There,
I am trying to copy a table and put the copy in a folder called "My Data Sources". The reason being when I set up a mail merge letter it defaults to "My Data Sorces" for the recipient data. I also need the second table to be updated every time we enter data in the original table.Has anyone got any ideas please????
Best Regards
Keith
View 1 Replies
View Related
Nov 25, 2005
Hi
Please can some help me asap. I need to do a querie which joins two tables together. I have a telemarketing table and an appointment table. The idea is that when an appointment is made telemarketing should be done afterwards to the same company. Therefore I want to view all of the telemarketing done and all of the appointments done and then match companies which have had both an appointment and telemarketing. However when i do this if there has been more appointments made for one company that there has been telemarketing the telemarketing duplicates itself so that the two have the same amount done which is not what I want??? Does this make sense?? Can some one please help????
Thanks
View 10 Replies
View Related
Nov 5, 2007
I have a query where I want to type in the part number and the begin and end dates and have that information appear.
In part number I have
[form]![frmTest]![Test_Part]
and in Date I have
Between [forms]![frmTest]![Test_Date].[startdate] And [forms]![frmTest]![Test_Date].[enddate]
It is duplicating my records and not pulling all of them, any help here what be great.
View 14 Replies
View Related
Jan 10, 2008
Hi Guys
Not sure what I should do here. I would like to have a cell populate with the value of a specific cell previously.
explain:
in excel, we can use formulas like this:
A1: 00:00 B1: 08:30
A2: 08:30 B2: 13:00
A3: 13:00 B3: 15:00
etc, etc
Notice that each cell in A is the same as the previous B Cell. So the formula for Cell A2 would be something like: =IF(B1>0,B1,"00:00")
and Cell B3 would be =IF(B2>0,B2,"00:00")
The fields I have in Access are:
TimeIn TimeOut
So I would need to get TimeIn to be the same as the previous timeout???
Not sure If I'm making any sense right now :)
View 5 Replies
View Related
Sep 21, 2005
Hello,
I know it's against any database logic but I need a code behind a a button to copy data from one field to another.
What I am trying to do is:
I have a table with two fields:
Father Last Name (txtFLN)
Child Last name (txtSLN)
When writing my data to the table (I use a form named MASTER), I type the father's last name and would like a button that copies that same entry in the other field?
Any help?
View 1 Replies
View Related
Jan 13, 2007
I have a table named tblProduct,
I have a table names tblProductSpec,
tblProduct contains basic info, tblProductSpec contains infomation linked with outer tables. What I need to is have the product ID's duplicated in tblProductSpec. Is it possible to do this via relationships etc?
Any help greatly appreciated. :)
-Adzi
View 3 Replies
View Related
Jul 6, 2006
Hi
I need to be able to copy 5/6 fields from one record to the next then carrying on entering different data, ie copy date, location, time then enter name address etc.
I can copy the whole record but not just a couple of fields
Any ideas?
I am using access 2000.
Thanks
View 13 Replies
View Related
Aug 18, 2004
I have a report for parking tickets. In the report is a subreport listing each violation on the parking ticket referenced on the report.
Everything works fine except for tickets with multiple violations. For example, some tickets with two violations come out correctly on the subreport (both violations listed). Others show one of the violations listed twice and the other violation not listed at all. The queries behind the report and subreport show the correct information without the duplications.
I've tried sorting and grouping to no avail.
Any assistance is greatly appreciated. Thanks.
View 2 Replies
View Related
Apr 20, 2007
Okay, I've learned TONS from this forum alone as a self-taught database user. But now I'm in a rut... I created a query that contains the following fields:
Termination Date, Name, Rehireable?(yes/no), and age (if statement). This is the if statement someone helped me to write:
Ages: IIf([Age] Between 16 And 20,"16-20",IIf([Age] Between 21 And 25,"21-25",IIf([Age] Between 26 And 30,"26-30",IIf([Age] Between 31 And 35,"31-35",IIf([Age] Between 36 And 40,"36-40",IIf([Age] Between 41 And 45,"41-45",IIf([Age] Between 46 And 50,"46-50","Over 50")))))))
At first glance things looked fine but I checked again and the data is all duplicated - each employee is showing one record for rehireable (yes) and another record for non-rehireable (no).
I'm not even going to think about getting into this more until Monday, so if you have any insight on why my data is doubled I would REALLY appreciate it. Thanks!
View 3 Replies
View Related
Feb 10, 2007
Here's another one I'm stumped on. What would be the best way to do this... if it can be done:
The tables in question are the following:
1. Exhibitors (stores exhibitor data, i.e. name, age, address, etc)
2. Livestock (stores livestock data for each exhibitor, i.e. breed, weight, gender)
3. Shows (stores data about each show, i.e. title, date, location)
I would like to have the Shows table to also store which exhibitors and livestock participated at this show. For example:
County Show: Jane Doe (exhibitor) - blackie, whitie (livestock)
John Smith - spot, blue, cutie-pie
James Black - smokey, sassy, fluffy
State Show: Jane Doe - blackie
James Black - spot, blue, cutie-pie, snuffles
Christy Meek - baby, apples
The problem is that each show will be associated with multiple exhibitors (and their different livestock). AND each exhibitor (and their livestock) will be associated with different and often times multiple shows.
So what would be the best way to have the Shows table pull the exhibitor and livestock data without having to duplicate exhibitor records for each show?
View 7 Replies
View Related
Feb 9, 2007
First off a big thank you to this forum... have solved a lot of questions I have had and some I never knew I had. Keep in mind this is all from a non-programmer so my question(s) might not be technically sound.
The issue I have is I have built a database to track documents that we process. It is uses an autonumber and that has worked great. The issue is eventually this document gets processed in our accounting system and I want to retrieve data from there and add it to the document record.
I figured out how to like the ODBC database and that worked, but I get an expression error. The field in the ODBC database is text and in Access it is an Autonumber.
Is there a way to copy the autonumber field and change it to text property to align with the other database?
All help welcome and appreciated.
View 4 Replies
View Related