Saving The Origional Form when Data is Modified

Waldin

Registered User.
Local time
Tomorrow, 01:02
Joined
Oct 11, 2012
Messages
109
hi all

i've been wrecking my brains tryng to get this to work.

when i open a form containing a quotation and change some of the data in the quotation i would like access to automatically save the origional quote, and save the modified quotation under a diferent number(the quotes have unique track numbers).

at the moment when an existing Quotation is modified it saves. and the origional data is lost, this is what i want to avoid.

in need of a saviour!!!
 
Try the Form_OnDirty method..
Code:
Private Sub Form_Dirty(Cancel As Integer)
    DoCmd.GoToRecord , , acNewRec
End Sub
 
brilliant, thanks, thanks, thanks.

the Origional saves and that's what i wanted.

However the modified quote must still contain all the info the origional Quote has, the only difference would be the Track number that gets generated automatically and the modified data.

is this possible Eugin?
 
Will this help??
Code:
Private Sub Form_Dirty(Cancel As Integer)
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdCopy
    DoCmd.GoToRecord , , acNewRec
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdPaste
End Sub
 
if i could put two THUMBS UP, i would.

this is great, actually perfect, thanks.
 
...could you please explain me what the code means...if its not to much trouble.
 
You are most welcome, most certainly.. I am glad you asked..

First On dirty property is the event that is triggered when you make changes to already existing records. In other words when you try to 'edit'.. So that is what you want...

Next, DoCmd.RunCommand has several commands of which some are SELECT, COPY and PASTE. As you nedd to edit the quote and save it as a NEW quote, we do is make a copy of current record and go to a NEW record and paste the values. Then since the Forms is already dirty it will triggered only once..
 
great stuff, so basically its a copy and paste command?
 
could i add another line to the code which adds an increasing interger to the the name of the modified quotation depending on how many of the same quote gets modified?
 

Users who are viewing this thread

Back
Top Bottom