Unanswered: using sendobject based on dateadd value
G morning all,
OK I am back with my dateadd function again. Got my dateadd function working in a parameter query now. This query looks at maintenance of equipment due between two dates. The due date is calculated ith the dateadd function.
What I would like to do is use sendobject to mail the appropiate people if the datedue value (calculated via dateadd) is equal to the current system date "Date()".
I do currently have work order requests submitted via a form using sendobject to email the appropiate people when a new request is submitted.
I would love maintenance due via the value of the dateadd field to perform an append the workorder table as new request and send the email.
Of course the current sendobject os attached to a form submitted record. Is it possible to attach it to a new record added on the table level. and If so how do you base the append query on the dateadd value.
Ok ive created an append query that updates the work order table on the date of maintenance scheduled. Problem is if I use autoexec to run it automatically then it appends the table with the same records evrytime it opens (duplicate records in a given day). I would like to make this auto for end users. Any suggestions? Maybe run it once then attach it to the appropiate update or new record event on the form?
Here's the sql behind the query.
INSERT INTO tblWorkOrder ( numAssetTag, dtmDue, strSvcType, strAssignedTo, strReqBy )
SELECT qryMntc.idsAssetTag, qryMntc.dtmDateMntcDue, qryMntc.strMntcType, qryMntc.strByCompany, "Auto Attendant" AS strReqBy
Ok thought i would post an update for others who may find this info usefull.
I've ended up creating a bln field called appended in the maintenance hx table. By default this field is set to no/false. Autoexec now runs the append query based on <= Daqte() and the value of "no" in the appended field. Autoexec then runs an update query and changes all no values to yes in this field. Hence records are not appended twice to the work order table.
Now all I have to do is add something to the form for "changes" to existing work order records.