help with duplicate record for revision

  • Thread starter Thread starter Chris
  • Start date Start date
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
 
Well just realisaed the workstation I was working on was not up to date with
SP1a. After installing everything seems to work ok. Hope this helps someone
else.
Chris
 
Back
Top