'from request page
Private Sub cmdsave_Click()
Dim ians As String
On Error GoTo Err_cmdsave_Click
If Me.DataEntry = True Then
Me.DateReceived = Me.DateRequested
End If
If Me.Department.ListIndex < 0 Then
MsgBox "Please select a Department.", vbOKOnly, "Error"
Department.SetFocus
Else
If Me.Library.ListIndex < 0 Then
MsgBox "Please select a library.", vbOKOnly, "Error"
Library.SetFocus
Else
If IsNull(Form_frmTapeRequestItemsV2.[fk tape ID]) Then
MsgBox "You must add at least one item to be dubbed.", vbOKOnly, "Error"
Else
'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim sUpdate As String
sUpdate = "Update [tbl_request item] SET [dubs]= " & [Dubs] & _
"WHERE [fk request id] = " & Form_frmTapeRequest.Request_ID
DoCmd.RunSQL sUpdate
ians = MsgBox("Request saved, would you like to add another one?", vbYesNo, "Tape Library")
If ians = vbYes Then
DoCmd.GoToRecord , , acNewRec
Else
'update the records in tape request and send email
sendEmailCDO " ", " ", "New Tape Requests"
MsgBox "Thank you. An email has been sent regarding your tape request."
DoCmd.SetWarnings True
DoCmd.Close
Form_frmRequest.lsRequest.Requery
End If
End If
End If
End If
Exit_cmdsave_Click:
Exit Sub
Err_cmdsave_Click:
MsgBox Err.description
Resume Exit_cmdsave_Click
End Sub