Search results

  1. W

    Date query - how do I find the last April?

    Got it sorted thanks, used this: App1: Count(IIf([RTB1] Between DateAdd("yyyy",-1,"01/04/" & Year(Date())) And DateAdd("yyyy",-1,"30/04/" & Year(Date())),0))
  2. W

    Date query - how do I find the last April?

    Hi Ranman, so my code should look like this? App1: Count(IIf([RTB1] Between DateAdd("yyyy",-1,"01/04/" & Year(Date)) And DateAdd("yyyy",-1,"30/04/" & Year(Date)),0)) When I add it to my query Access adds brackets to the Date like this...App1: Count(IIf([RTB1] Between DateAdd("yyyy",-1,"01/04/" &...
  3. W

    Date query - how do I find the last April?

    Hi, I have several queries based around the financial year so they mostly begin in April (01/04). The following code will count all rows in April of the current year, but if I run it in January it obviously returns zero. Count(IIf([RTB1] Between "01/04/" & Year(Date()) And "30/04/" &...
  4. W

    Using query to populate email body

    YES YES YES! Got it, I'd left a bracket open after changing to American format. Thanks all for your help. Much appreciated
  5. W

    Using query to populate email body

    Ok, so I'm now sending the dates in American format. SELECT tblRTBApps.[CHS No], tblRTBApps.[RTB1], chs_table.ADDRESS, chs_table.PostCode FROM chs_table INNER JOIN tblRTBApps ON chs_table.CHS_NO = tblRTBApps.[CHS No] WHERE (((tblRTBApps.[RTB1]) Between #11/02/2016# And #11/30/2016# ORDER BY...
  6. W

    Using query to populate email body

    Hi Minty, this is what is being sent when I select dates, can't see too much wrong with it tbh. SELECT tblRTBApps.[CHS No], tblRTBApps.[RTB1], chs_table.ADDRESS, chs_table.PostCode FROM chs_table INNER JOIN tblRTBApps ON chs_table.CHS_NO = tblRTBApps.[CHS No] WHERE (((tblRTBApps.[RTB1])...
  7. W

    Using query to populate email body

    Hi there, thanks for the reply, my WHERE now looks like this and generates this error: "WHERE (((tblRTBApps.[RTB1]) Between #" & Me.[txtStartDate] & "# And #" & Me.[txtEndDate] & "# " Runtime error 3075 Syntax error (missing operator) in query expression
  8. W

    Using query to populate email body

    Hi, I'm using the code below to create an email and then populate it with the results of the query - this works fine. Note the WHERE part of the query - we'll be revisiting it soon.... Private Sub CmdEmail_Click() Dim olApp As Object Dim olItem As Variant Dim olatt As String...
  9. W

    OPening Word doc from button

    Not for me :(
  10. W

    OPening Word doc from button

    Hi, yes I added thumbs up but I can't see a 'Thanks' button
  11. W

    OPening Word doc from button

    Fantastic - it works! Thanks very much for your help.
  12. W

    OPening Word doc from button

    you want frmProjDetails and the button is cmdInstruct
  13. W

    OPening Word doc from button

    db attached Thanks
  14. W

    OPening Word doc from button

    How do I post my db? Site only allows up to 2mb for accdb files.
  15. W

    OPening Word doc from button

    Hi JHB, yes, word still opens on second click (after I uncomment OnError) BTW I'm running Office/Access 2010 on Win7
  16. W

    OPening Word doc from button

    Hi JHB, thanks for the tip - the error I get is Run-time error 429, activeX component can't create object and highlights this code: Set appWord = GetObject(, "Word.Application") a quick google suggests adding DAO references but they are already added. Also suggests reinstalling...
  17. W

    OPening Word doc from button

    Hi all, I want a word doc to open when I click a button - simple. The problem is that I have to click the button twice to get the doc to open. How do I get it to work on a single click? Many thanks Here's my code: Private Sub cmdInstruct_Click() Dim appWord As Word.Application Dim doc...
  18. W

    Error 424 when opening .xlsx from Access 2010

    Yep, tried that as well - on both 32 and 64bit pcs for good measure...... can you get the doc to open correctly at your end?
  19. W

    Error 424 when opening .xlsx from Access 2010

    Hi, I've tried a new document but get same results - here's a copy of the spreadsheet I'm trying to open - it's just a blank document that I've been using for testing so there's nothing special about it, also tried opening it from various locations to make sure it's not a permissions problem...
  20. W

    Error 424 when opening .xlsx from Access 2010

    Nope, I've purposely kept the filepath as short as possible - I hate long filepaths .
Back
Top Bottom