I have a problem I need some help with.
In my Access 2000 database (used for logging complaints to my company), I'm using the following code to send an email to our finance dept when a refund is requested:
Expand|Select|Wrap|Line Numbers
- Private Sub Save_Record_Click()
- On Error GoTo Err_Save_Record_Click
- Dim strTo As String
- Dim strCC As String
- Dim strSubject As String
- Dim strBody As String
- Dim FirstFile As String
- If RefundStatus = "sent" Then
- MsgBox "THIS REFUND HAS ALREADY BEEN SENT - LOG NOT SAVED"
- Exit Sub
- Else
- End If
- If Confirmation = -1 Then
- strCC = "email@provider.com"
- Else:
- strCC = ""
- End If
- strTo = "email2@provider.com"
- strSubject = "Refund"
- strBody = "Refund for authorisation"
- FirstFile = "h:\financereport.rtf"
- DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
- If Refund_Amount > 0 Then
- If fIsAppRunning = False Then
- MsgBox "PLEASE LOG ON TO LOTUS NOTES BEFORE TRYING TO SEND REFUND REQUEST" & Chr$(10) & " *REFUND NOT SENT*"
- Exit Sub
- Else
- End If
- DoCmd.OutputTo acOutputReport, "FinanceReport", acFormatRTF, "H:\financereport.rtf"
- SendNotesMail strTo, strCC, strSubject, strBody, FirstFile
- RefundStatus.SetFocus
- RefundStatus.Text = "sent"
- DoCmd.GoToRecord , , acNext
- MsgBox "REFUND REQUEST HAS BEEN SENT TO FINANCE" & Chr$(10) & " * LOG SAVED, THANK YOU *"
Crunch time: Is there a way I can retrieve the details for the CURRENT record, rather than the record with the highest reference number?
Any help gratefully received.
Many thanks,
Olly