var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Problem with code...
I need some expert help here!
I have a button on a form, which, once clicked goes to the query "open Issues", and I want it to send an email for all the open records.
The code below sends the email, etc., but it only finds the first record, and populates the email continuously with the same data?
I bet this is something really easy for someone to point out the error of my ways, so I am looking for that person!
Any help and advise is greatfully appreciated.
Private Sub EmailButton_Click()
Dim eSub, eText As Variant
Dim rst As dao.Recordset
Set rst = CurrentDb.OpenRecordset("open issues")
Do While Not rst.EOF
eSub = "E Notification - Number: " & Me.ID
msgMessage = "We have been notified by the local authority regarding the following incident:" & [SiteID] & " at " & Me.Date & " " & Me.Time
emailaddress = "firstname.lastname@example.org"
eText = msgMessage
DoCmd.SendObject , , , emailaddress, , , eSub, eText, False
You open up the recordset but then never use the data from it.
Instead of using Me.ID, Me.Date, etc...you need to use rst!ID, rst!Date, etc.
Hope that helps.