koolwaters
Active Member
- Joined
- May 16, 2007
- Messages
- 403
I am trying to copy certain fields from one record on a continuous form to the next but I do not want it written to the table until the user clicks save.
Here is the code I am currently using, which writes the record to the Claims table.
Any suggestions?
Thanks
Here is the code I am currently using, which writes the record to the Claims table.
Code:
Private Sub cmdAdditionalClaim_Click()
Dim dbs As DAO.Database, rst As DAO.Recordset
Dim F As Form
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Dim stDocName As String
Dim i As Integer
Msg = "Are you sure you want to create a new claim?"
Style = vbYesNo + vbInformation
Title = "Duplicate Claim?"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblClaim")
'Set rst = DoCmd.GoToRecord , , acNewRec
Set rst = Me.RecordsetClone
Me.Tag = Me![ClaimID]
With rst
.AddNew
!ClaimID = Nz(DMax("[ClaimID ]", "tblClaim"), 0) + 1
(I have all of the other fields listed here)
.Update
.Move 0, .LastModified
End With
Me.Bookmark = rst.Bookmark
End If
End Sub
Any suggestions?
Thanks