smtazulislam
Member
- Local time
- Today, 03:55
- Joined
- Mar 27, 2020
- Messages
- 806
I am looking to copy a record on a continuous form and insert this copy as a new record. and in this table name filed like; HealthInsID, EmployeeID, HealthCardNo, Relationship, PolicyNo, class, SponsorID, IssueDate, ExpiredDate, TerminationDate, TerminationReasons, Note.
Please check the design view .
HealthCardNo is in index "No Duplicate"
This is the Contentious Form
Needs to copy RED MARK Fields where is code..
But database not execute, Error.
Please check the design view .
HealthCardNo is in index "No Duplicate"
This is the Contentious Form
Needs to copy RED MARK Fields where is code..
Code:
Private Sub cmdCopy_Click()
Dim strSQL As String
strSQL = "INSERT INTO tblHealthInsurance (HealthInsID, EmployeeID, HealthCardNo, Relationship, PolicyNo, class, SponsorID, IssueDate, ExpiredDate, TerminationDate, TerminationReasons, note) " & _
"VALUES(#" & Me.IssueDate & "#, '" & Me.Relationship & "','" & Me.PolicyNo & "', '" & Me.Class & "', '" & Me.SponsorID & "', #" & Me.ExpiredDate & "#);"
CrrrentDb.Execute strSQL, dbFailOnError
End Sub
But database not execute, Error.