Hi
I have a continious form, based on a query which will usually display between 5 and 10 records. The form has various fields, including a date one called 'sent'
The form has a button 'Send email' which opens a pop-up form displaying email addresses. The user selects one or more email addresses and clicks 'send audit report' which sends the form as an excel spreadsheet. What I'd like is for the field 'sent' to be updated with todays date, but my code only puts todays date in the first record NOT all of them. Any help much appreciated. The line of code I'm getting wrong is
Forms!testemail!sent = Date
regards
Gruff
Dim strmsg As String
If IsNull(send) Or Me.send = "" Then
Msgbox "You must select at least one e-mail name", vbInformation
Else
strmsg = "Click Yes to send an e-mail to:" + Chr(10)
strmsg = strmsg + [Forms]![email_send]!send
If Msgbox(strmsg, vbYesNo, "Email" = vbYes Then
DoCmd.SendObject acSendForm, "testemail", acFormatXLS, Me.send, , , "Audit Recommendations Report", "The attached excel spreadsheet details Audit recommendations for " & Chr(13) & Forms!testemail!service_name & Chr(13) & Forms!testemail!section & Chr(13) & "The audit was completed on" & " " & Forms!testemail!audit_completed & Chr(13) & "Please ensure all responsible people are made aware of their recommendations and could I ask you to return the spreadhseet with the following completed details" & Chr(13) & "target date" & Chr(13) & "officer acceptance" & Chr(13) & "officer comments - if applicable" & Chr(13) & "Completed date - if applicable" & Chr(13) & Chr(13) & "Thank you for your time" & Chr(13) & "Brian Gell - Senior Auditor", True
Forms!testemail!sent = Date
DoCmd.close acForm, Me.name
DoCmd.close acForm, "testemail"
Else
End If
End If
I have a continious form, based on a query which will usually display between 5 and 10 records. The form has various fields, including a date one called 'sent'
The form has a button 'Send email' which opens a pop-up form displaying email addresses. The user selects one or more email addresses and clicks 'send audit report' which sends the form as an excel spreadsheet. What I'd like is for the field 'sent' to be updated with todays date, but my code only puts todays date in the first record NOT all of them. Any help much appreciated. The line of code I'm getting wrong is
Forms!testemail!sent = Date
regards
Gruff
Dim strmsg As String
If IsNull(send) Or Me.send = "" Then
Msgbox "You must select at least one e-mail name", vbInformation
Else
strmsg = "Click Yes to send an e-mail to:" + Chr(10)
strmsg = strmsg + [Forms]![email_send]!send
If Msgbox(strmsg, vbYesNo, "Email" = vbYes Then
DoCmd.SendObject acSendForm, "testemail", acFormatXLS, Me.send, , , "Audit Recommendations Report", "The attached excel spreadsheet details Audit recommendations for " & Chr(13) & Forms!testemail!service_name & Chr(13) & Forms!testemail!section & Chr(13) & "The audit was completed on" & " " & Forms!testemail!audit_completed & Chr(13) & "Please ensure all responsible people are made aware of their recommendations and could I ask you to return the spreadhseet with the following completed details" & Chr(13) & "target date" & Chr(13) & "officer acceptance" & Chr(13) & "officer comments - if applicable" & Chr(13) & "Completed date - if applicable" & Chr(13) & Chr(13) & "Thank you for your time" & Chr(13) & "Brian Gell - Senior Auditor", True
Forms!testemail!sent = Date
DoCmd.close acForm, Me.name
DoCmd.close acForm, "testemail"
Else
End If
End If