Hi all,
This may be obvious, but the following code gives me an error of "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done". The code seems to trip up on the txtAdmissionsNumber (emboldened below) having played around with breakpoints. Any suggestions as to where I need to investigate further? The work flow is as follows:
Select person on a form. Click to bring up from on which this button resides to request additional info.
The report worked no problem before I added in the e-mail and add info to table but I may be conflicting something here... Any thoughts?
Simon
Private Sub btnStudentCoCrpt_Click()
On Error GoTo Err_btnStudentCoCrpt_Click
'check to see all is completed
If IsNull(cmbRequested) = True Then
MsgBox "Please complete the 'Requested By' Field", , "Missing : Requested By"
cmbRequested.SetFocus
Exit Sub
End If
If IsNull(cmbAuthorised) = True Then
MsgBox "Please complete the 'Authorised By' Field", , "Missing : Authorised By"
cmbAuthorised.SetFocus
Exit Sub
End If
If IsNull(txtChanges) = True Then
MsgBox "Please let us know what changes you want to make!", , "Missing : Changes"
txtChanges.SetFocus
Exit Sub
End If
'herd cats
If MsgBox("You are printing a course change form for " & Trim(Called) & _
". This form must be signed by all relevant parties before being returned to MIS for processing. " & _
"An email will be sent to inform people that this course change form has been raised. " & _
"If you wish to cancel this request, please click 'No'", vbYesNo, "Warning") = vbNo Then
Exit Sub
End If
'update table
Set db = New Connection
db.Provider = "SQLOLEDB"
db.ConnectionString = "user id = admin; data source = cedar; initial catalog=KIM;password=huddersfield"
db.Open
Set rec = New Recordset
strsql = "SELECT * FROM tbl_course_change_leaver"
rec.Open (strsql), db, adOpenDynamic, adLockOptimistic
rec.AddNew
rec!AdNo = txtAdmissionsNumber
rec!description = txtChanges
rec!RaisedBy = cmbRequested
rec!authorisedby = cmbAuthorised
rec!Date = Now()
rec!Type = "CC"
rec.AddNew
'send email
This may be obvious, but the following code gives me an error of "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done". The code seems to trip up on the txtAdmissionsNumber (emboldened below) having played around with breakpoints. Any suggestions as to where I need to investigate further? The work flow is as follows:
Select person on a form. Click to bring up from on which this button resides to request additional info.
The report worked no problem before I added in the e-mail and add info to table but I may be conflicting something here... Any thoughts?
Simon
Private Sub btnStudentCoCrpt_Click()
On Error GoTo Err_btnStudentCoCrpt_Click
'check to see all is completed
If IsNull(cmbRequested) = True Then
MsgBox "Please complete the 'Requested By' Field", , "Missing : Requested By"
cmbRequested.SetFocus
Exit Sub
End If
If IsNull(cmbAuthorised) = True Then
MsgBox "Please complete the 'Authorised By' Field", , "Missing : Authorised By"
cmbAuthorised.SetFocus
Exit Sub
End If
If IsNull(txtChanges) = True Then
MsgBox "Please let us know what changes you want to make!", , "Missing : Changes"
txtChanges.SetFocus
Exit Sub
End If
'herd cats
If MsgBox("You are printing a course change form for " & Trim(Called) & _
". This form must be signed by all relevant parties before being returned to MIS for processing. " & _
"An email will be sent to inform people that this course change form has been raised. " & _
"If you wish to cancel this request, please click 'No'", vbYesNo, "Warning") = vbNo Then
Exit Sub
End If
'update table
Set db = New Connection
db.Provider = "SQLOLEDB"
db.ConnectionString = "user id = admin; data source = cedar; initial catalog=KIM;password=huddersfield"
db.Open
Set rec = New Recordset
strsql = "SELECT * FROM tbl_course_change_leaver"
rec.Open (strsql), db, adOpenDynamic, adLockOptimistic
rec.AddNew
rec!AdNo = txtAdmissionsNumber
rec!description = txtChanges
rec!RaisedBy = cmbRequested
rec!authorisedby = cmbAuthorised
rec!Date = Now()
rec!Type = "CC"
rec.AddNew
'send email