C
Chris
Using the following code to create a duplicate record of a Quote. When I get
to the addnew line the current record that I am trying to duplicate is lost.
Any ideas what I'm missing.
Thanks
Chris
Private Sub cmdRevise_Click()
Dim strSQL As String
Dim rec As Recordset
Dim lngQuoteID As Long
Set rec = Form_Quotes.RecordsetClone
rec.Bookmark = Form_Quotes.Bookmark
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select the record to duplicate."
Else
'Duplicate the main record
With rec
.AddNew
!QuoteDate = Date
!QuoteNumber = Me.QuoteNumber
!ProjectID = Me.ProjectID
!EmployeeID = Me.EmployeeID
!RevisionNumber = Me.RevisionNumber + 1
!QuoteID = Me.QuoteNumber & ("-R" + (Me.RevisionNumber + 1))
'primary key
.Update
to the addnew line the current record that I am trying to duplicate is lost.
Any ideas what I'm missing.
Thanks
Chris
Private Sub cmdRevise_Click()
Dim strSQL As String
Dim rec As Recordset
Dim lngQuoteID As Long
Set rec = Form_Quotes.RecordsetClone
rec.Bookmark = Form_Quotes.Bookmark
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select the record to duplicate."
Else
'Duplicate the main record
With rec
.AddNew
!QuoteDate = Date
!QuoteNumber = Me.QuoteNumber
!ProjectID = Me.ProjectID
!EmployeeID = Me.EmployeeID
!RevisionNumber = Me.RevisionNumber + 1
!QuoteID = Me.QuoteNumber & ("-R" + (Me.RevisionNumber + 1))
'primary key
.Update