473,386 Members | 1,630 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,386 software developers and data experts.

Saving and Altering Records

Hi.

I am working on the following process, and I am stuck at the bold faced step:

Take an existing Record, displayed on my form.
alter it
save it as a new record

I have been playing around with the following codes

I don't know the syntax, but I would be after something along the lines of
DoCmd.Save as New Record, (Don't change this one) ??

Thanks in Advance.
Jun 12 '07 #1
8 1194
FishVal
2,653 Expert 2GB
Hi.

I am working on the following process, and I am stuck at the bold faced step:

Take an existing Record, displayed on my form.
alter it
save it as a new record

I have been playing around with the following codes

I don't know the syntax, but I would be after something along the lines of
DoCmd.Save as New Record, (Don't change this one) ??

Thanks in Advance.
I can suggest the following.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Command4_Click()
  3.     With DoCmd
  4.         .RunCommand acCmdSelectRecord
  5.         .RunCommand acCmdCopy
  6.         .GoToRecord acActiveDataObject, , acNewRec
  7.         .RunCommand acCmdPaste
  8.     End With
  9. End Sub
  10.  
  11.  
Jun 12 '07 #2
Thanks. That's getting there, that seems to
create the new record, however it updates the old record as well.
Any thoughts on that?
Jun 12 '07 #3
missinglinq
3,532 Expert 2GB
In what way does the code FishVal posted update your original record?
Jun 12 '07 #4
FishVal
2,653 Expert 2GB
Thanks. That's getting there, that seems to
create the new record, however it updates the old record as well.
Any thoughts on that?
I've tested this. It works fine at least with two controls on the form: one combo and one text.
Actually it performs old good Copy/Paste. Did you test it?
Jun 12 '07 #5
missinglinq
3,532 Expert 2GB
I think I've figured out what going on! Blair's altering the original record, then running FishVal's code! That's why it updating the original! Blair, you need to run FishVal's code, then alter the new, just created record!

The only problem I see with your code, FishVal, is that I think it'll bomb if any of the controls hold a field that is a Primary Key, as it'll be creating a duplicate.
Jun 12 '07 #6
I just tested it again.

I used the nav arrows to go back to an old record.I have a comments box on my form, and I changed the comment from "test 1" to "test 2". The new record
is generated with the comment "test 2", however the original form/record is changed such that the comment now reads "test 2" as well.

Thanks for thinking about this guys.
Jun 12 '07 #7
yep, you figured it out while i was writing my response. cool.
Jun 12 '07 #8
missinglinq
3,532 Expert 2GB
Glad you got it working!
Jun 12 '07 #9

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

Similar topics

5
by: Jack | last post by:
Hi, I need to build a asp page where it would serve as a data entry record page as well as display page for records saved. This page should also allow editing of records that has been saved. ...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
11
by: kaosyeti | last post by:
i have a form that records 9 fields into a table. on that form i have a 'done' button to close the form. right now, if the form is fully filled in, but you don't press 'enter' before you click...
4
by: John Kandell | last post by:
Hi, I posted this in the asp.net group, but didn't get a response. Maybe someone here can help me with this... --- Would someone be able to shed some light on what is the cost of saving a...
4
by: Dixie | last post by:
I have a spreadsheet that uses VBA code in Access to save itself as a text file. The line is as follows. xl.ActiveSheet.SaveAs CurrentProject.Path & "\Reports\" & DLookup("", "tblButtons",...
6
by: NutsAboutVB | last post by:
Hello, I am a .NET programmer and I have a JPEG image file (from digital camera) of about 109 KB's in size, when I open it and save it (without making any alterations at all, just going to File...
9
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. ...
5
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works...
3
by: Andy_Khosravi | last post by:
I'm having a problem with an entry form on one of my applications. It would appear that the save action is sometimes not working, and is generating no error when it fails. I'm hoping one of you may...
2
by: darrel | last post by:
Hi there vb masters i have a problem regrading the saving procedure in my program: Here my code: Private Sub cmdSave_Click() Dim rsShowRec As New ADODB.Recordset Dim cnn As New...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
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
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...

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.