Hello,
I am getting an error when I am trying to add a record through adodb .addnew. The error is:
Run-time error '-2147217887(80040e21) Multiple-step operation generated errors. Check each status value.
When I hit debug it highlights the line:
.Fields!OpenDate = txtOpenDate(you will see it below in it's context.)
Here is the code that I am using:
Private Sub cmdSave_Click()
Dim Con As ADODB.Connection
Dim rst As ADODB.Recordset
Set Con = New ADODB.Connection
Con.CursorLocation = adUseClient
Con.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\sfunk\My Documents\JobTracker\jobTracker.mdb;Persist Security Info=False"
Set rst = New ADODB.Recordset 'specifying attributes to this recordset
With rst
.ActiveConnection = Con
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "tbl_Job_Tracker"
End With
With rst
.AddNew
'.Fields!JobID =
.Fields!CompanyName = txtCompany
.Fields!Contact = txtContact
.Fields!Title = txtTitle
.Fields!OpenDate = txtOpenDate
.Fields!Address = txtAddress
.Fields!Phone = txtPhone
.Fields!Fax = txtFax
.Fields!Email = txtEmail
.Fields!URL = txtURL
.Fields!CorpURL = txtCorpURL
.Fields!SentResume = chkResumeSent
.Fields!FirstCall = chkFirstCall
.Fields!SecondCall = chkSecondCall
.Fields!LastCall = chkLastCall
.Fields!PendingAction = chkActionPending
.Fields!InterviewDate = txtInterviewDate
.Fields!FollowUpCall = chkFollowUpCall
.Fields!FollowUpCall2 = chkFollowUpCall2
.Fields!HearFromDate = txtHEarFromDate
.Fields!Notes = txtNotes
.Update
End With
cmdSave.Visible = False
End Sub
Sincerely,
Steve Funk
I am getting an error when I am trying to add a record through adodb .addnew. The error is:
Run-time error '-2147217887(80040e21) Multiple-step operation generated errors. Check each status value.
When I hit debug it highlights the line:
.Fields!OpenDate = txtOpenDate(you will see it below in it's context.)
Here is the code that I am using:
Private Sub cmdSave_Click()
Dim Con As ADODB.Connection
Dim rst As ADODB.Recordset
Set Con = New ADODB.Connection
Con.CursorLocation = adUseClient
Con.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\sfunk\My Documents\JobTracker\jobTracker.mdb;Persist Security Info=False"
Set rst = New ADODB.Recordset 'specifying attributes to this recordset
With rst
.ActiveConnection = Con
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "tbl_Job_Tracker"
End With
With rst
.AddNew
'.Fields!JobID =
.Fields!CompanyName = txtCompany
.Fields!Contact = txtContact
.Fields!Title = txtTitle
.Fields!OpenDate = txtOpenDate
.Fields!Address = txtAddress
.Fields!Phone = txtPhone
.Fields!Fax = txtFax
.Fields!Email = txtEmail
.Fields!URL = txtURL
.Fields!CorpURL = txtCorpURL
.Fields!SentResume = chkResumeSent
.Fields!FirstCall = chkFirstCall
.Fields!SecondCall = chkSecondCall
.Fields!LastCall = chkLastCall
.Fields!PendingAction = chkActionPending
.Fields!InterviewDate = txtInterviewDate
.Fields!FollowUpCall = chkFollowUpCall
.Fields!FollowUpCall2 = chkFollowUpCall2
.Fields!HearFromDate = txtHEarFromDate
.Fields!Notes = txtNotes
.Update
End With
cmdSave.Visible = False
End Sub
Sincerely,
Steve Funk