help with duplicate record for revision

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
 
C

Chris

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top