Recent content by DonnaCulff

  1. D

    Email generation & tracking system - loops querydefs recordsets...

    Currently I am looking at using a field added to a query to mark (with a minus 1) the previous weeks completed work requests Prev Week Completed: Year([ModDate])*53+DatePart("ww",[ModDate])=Year(Date())*53+DatePart("ww",Date())-1 Then I am looking at working this in somewhere to loop round...
  2. D

    Email generation & tracking system - loops querydefs recordsets...

    Good afternoon, I have a previous post linking to this one but the way i am now doing it is different (Hence this new post) My aim is to import data, use a query to pull back the previous weeks data. Generate an email with this data. Then, the next week, import that data and send that...
  3. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    qryCompleteWorkRequests has a field called Modified which is a date when the work request was complete. The user specifies a date range to email all the people who raised the work requested completed in say a week... It works for the 1st record...but not the remaining. I have a feeling that it...
  4. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    OK I reconnected to copy of the linked table but where i could put different dates in... I only produces one email. The loop cannot be working correctly. I do not get any error messages, any ideas?
  5. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    I feel like I have been constantly coding through the night! The two pieces of code I have work to some extent. The following code takes the work request puts it into a table and then calls a module to generate the email. It then time and date stamps it. Sent marker and user etc. The bit i...
  6. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    This is great! I found a site which explained this just before your post and I am working on QueryDefs and trying to open up the email now. Thanks again for your invaluable help
  7. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    OK, I found a DAO Example and put it in a seperate module and ran that based on my query. I got an error saying "Too few parameters. Expecting 2" rather than one now. Instread of writing the SQL I reference the query itself Set MailList = db.OpenRecordset("qryCompletedWorkRequests") This...
  8. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    It shows the SQL with the date I entered. So it seems to work. When I copy the SQL into the Query design grid in SQL view and then change it to design view and then I run it, it also works... very confusing! The query i refer to has a parameter of complete already specified and then I want the...
  9. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    Here is some background. . . Main functionality - Generating an email from query results. Updating query results and sending the new emails out excluding the ones already sent I have 2 Tables Work_Requests, tblWorkRequests, 1 Queries...
  10. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    This is what i have so far: Public Sub ControlOutlook2() Dim objOutlook As New Outlook.Application Dim objEmail As Outlook.MailItem Dim strLtrContent As String Dim strEMailMsg As String Dim rsContacts As DAO.Recordset Dim strSql As String Dim ctlEmailBox As String...
  11. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    I haven't finished the start of the code. I got confused with switching from ADO to DAO and back so now trying to transflate one in the other but every example i have does it in a slighly different way? Do you have any sample code?
  12. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    I can not get round the too few parameters. expected 1. It can't be getting the date from the form...? The field on the form frmCompletedWorkRequestsFROMteamsite is called Modified (the text control) with a control source of ModDate. I am trying to say where the...
  13. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    I have been changing and looking at code so long I didn't even see that. I will change and work through the errors. Thanks for your help
  14. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    Public Sub ControlOutlook2() Dim rst As DAO.Recordset strSQL = "" strSQL = strSQL & " SELECT qryCompletedWorkRequests.* " strSQL = strSQL & " FROM qryCompletedWorkRequests " strSQL = strSQL & " WHERE qryCompletedWorkRequests.ModDate=#" &...
  15. D

    Opening an ADODB.Recordset with an SQL statement,taking into account a date on a form

    Thanks! I didn't even realise it was not turned on :) You dont need the the Option Explicit at the top of a module window though do you? This is where my code is. I call it from the code behind the main form "frmCompletedWorkRequestsFROMteamsite" If i run the code in my module then i get...
Top Bottom