473,465 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Save Update to a current record as a NEW RECORD

51 New Member
I have a form that allow users to view the record, make update to the record, but then I want to allow user to save the update as a NEW RECORD. this is my code, and I need help.

doCmd.save "frmReview",,acNewRec
doCmd.close acform, "frmReview"

thanks!
Aug 20 '08 #1
1 2239
missinglinq
3,532 Recognized Expert Specialist
You really can't do this in Access. You'll need to copy the current record data to a new record, then change the data as needed, being sure to change the data in any fields that have to be unique, such as the Primary Key, if it's not an AutoNumber.

Here's some simple code to copy the record; Place a command button on your form and name it cmdCopyRecord.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdCopyRecord_Click()
  2.   DoCmd.RunCommand acCmdSelectRecord
  3.   DoCmd.RunCommand acCmdCopy
  4.   DoCmd.GoToRecord , , acNewRec
  5.   DoCmd.RunCommand acCmdPaste
  6. End Sub
  7.  
Linq ;0)>
Aug 20 '08 #2

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

Similar topics

4
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
2
by: dixie | last post by:
I know I've asked this before, but the answer elludes me and the message has long since disappeared from my newsgroup messages. How do you save a record using vba from a button or as part of an...
2
by: Tom Weston | last post by:
Help I need to save the current record before sending a simple report from it as an email using an event. The following code works for old records but not for the current new one: ------...
2
by: jaYPee | last post by:
i'm wondering how can i update the current record in datagrid while still editing the record. cause i have a checkbox in my datagrid and i want to save the record before changing the value of this...
22
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
1
by: David | last post by:
Hi, I have a continuous form with 'x' amount of records. 1 field on each record is a number, of which I have a field at the top of the form which just shows the running sum. If I enter a new...
4
by: nch1978 | last post by:
I am new to programming and am sorry if this post is in the wrong area. I have a listbox bound to a table and a datagrid bound to another one with a connection through xml. I can change the data...
2
by: Ian | last post by:
I am trying to save the current record on a form before opening a report, doesn’t sound to hard does it? The code on a buttons on click event goes like this: DoCmd.DoMenuItem acFormBar,...
1
by: forum.microsoft.com | last post by:
inserted record is present only in the dataset/bindingsource but not in the sql table same for updated record, changes is only in the dataset or the bindingsource but not in the actual physical...
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
marktang
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,...
0
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...
1
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...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.