473,383 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

how to duplicate a record which is selected by a query using a button

hi,

i have a subform giving the information of a person's history information, and another subform showing the latest information.

i would like to duplicate the latest information as a new record, then modify it and save it.

anyone helps? thanks a lot!
Oct 24 '16 #1
5 802
PhilOfWalton
1,430 Expert 1GB
Why two subforms?

Surely the moment you enter a new record, it becomes history.

Phil
Oct 25 '16 #2
Hi,

thank you for the reply.

the thing is I want to keep the current record, so i need to duplicate it and modify the duplicated one.
Oct 25 '16 #3
PhilOfWalton
1,430 Expert 1GB
Sorry. I'm going to bow out of this, as I can't understand what is wanted. It sounds as if you want 2 current history records.

Sorry

Phil
Oct 25 '16 #4
Thanks a lot! maybe i didn't explain it well. let me give an example.

ID NAME FRUIT START_DATE END_DATE
1 TOM APPLE 1/1/2016 3/1/2016
2 TOM APPLE,BANANA 3/1/2016 5/1/2016
3 TOM BANANA 5/1/2016 7/1/2016
4 TOM BANANA,GRAPE 7/1/2016

There are 4 records for TOM.
if i want to add a record for him, i need to copy the most recently record(now it is record 4) and modify it. but in form we always modify the information which is already in the table.

so how can i copy this record, with multi-value field?

thanks!
Oct 26 '16 #5
PhilOfWalton
1,430 Expert 1GB
OK, I understand what, but I don't understand why.

Can the whole thing be done on a continuous subform?
Your button can be used to
1) Move to the last record.
2) Save the fields in your last record into strings and numbers defined in your VBA.
3) Create a new record using those saved fields
4) Requery the subform
5) Go to the last record and modify it as required.

I have never seen anything like this before. I'm curious as to your table structures, and even more curious as to what you are trying to achieve. I looks vaguely like a list of transactions on different dates ... but vaguely is the operative word.

Hope this helps, if not give us more information.

Phil
Oct 27 '16 #6

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

Similar topics

8
by: Ray | last post by:
I have a data input form and need to automatically duplicate the existing record as a new record by clicking a button. The main purpose to duplicate the record is that the new record is very...
0
by: Cyberwolf | last post by:
OK, how to explain this. I have a table that will feed into another table using an append query. What I want to do is look at the table I am appending the record to to check for a duplicate...
1
by: 2D Rick | last post by:
Access2003 in XP If I open a form to a specific record and click on a command button with the following code I get a duplcate record: DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand...
7
by: dscarbor | last post by:
I have a simple form with 4 fields, and a subform that retrieves records that are potential matches based on a query. The user will use the ID from the subform record and enter it into one of the...
1
by: bemadragon | last post by:
Hello, I have been struggling with this for a while. I am working on a rather simple database for calculation purposes in Access 2003. I have a table called Order that has a primary key field...
1
by: mlb992000 | last post by:
I have a form that has a duplicate record command button that allows the user to duplicate all information on the form and change two fields. I need to create an event that will clear the two fields...
2
by: newaccessuser13 | last post by:
I am relatively new to Access (2010) and I am having difficulties in making a duplicate record button that was created with the wizard work correctly. I have a very simple database and form. To...
2
by: yaozaah04 | last post by:
Hello, I am working on a data entry form using Microsoft Access 2010 and I am supposed to give the user a separate option to look for a duplicate record. However the duplicate record-checking works...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.