Search results

  1. D

    Exporting to Excel (Formatting Issues)

    Private Sub CmdRateCardExport_Click() 'On Error GoTo Err_CmdRateCardExport_Click Dim CMS As String Dim Site As String Dim x As Integer Dim y As Integer Dim j As Long Dim k As Long Dim objexcelapp As Excel.Application Dim objexcelwb As Excel.Workbook CMS =...
  2. D

    Exporting to Excel (Formatting Issues)

    Yeah thats the problem, it leaves an excel.exe open in the processes after the first time. I've read the article too, but im still a bit lost. My code opens excel with: Set objexcelapp = New Excel.Application Set objexcelwb = objexcelapp.Workbooks.Open _...
  3. D

    Exporting to Excel (Formatting Issues)

    Thanks Bob, a silly mistake to miss. The code is now working, but if i run the code a second time i get an error of "Method 'Columns' of object '_Global' failed" on: j = objexcelapp.WorksheetFunction.CountIf(Columns("B:B"), "Core Fleet") If i end the code and run again it works.
  4. D

    Exporting to Excel (Formatting Issues)

    Hi Sorry for the late response... i think i've fixed the horizontal allignment issue, but I'm having a number of issues with the code, This particular one is getting an error at .TintAndShade = 0. The error reads "Method or data member not found". objexcelapp.Range("A2:B3").Select...
  5. D

    Exporting to Excel (Formatting Issues)

    Hi just wondering if you ever got this working? I'm having the same type of issues on horizontalalignment. Cheers
  6. D

    Excel code error

    Hi I'm using code in an Aceess Database to export a query to excel then format the spreadsheet. if i run the code once, it works fine but if i run it again i get an error message - "Run-time error '1004': Method 'Columns' of object '_Global' failed. It hangs on: j =...
  7. D

    bold line in auto email code

    Thanks - that helped out heaps.
  8. D

    Dcount records by date

    Now that makes sense... Got it working. I changed the format in my query to "mm" and here's the code I finished up with. =DCount("[id]","[qrysso]","[ssoyear]= " & Year(DateAdd("m",-1,Date())) & " And [ssomonth]= " & Month(DateAdd("m",-1,Date()))) Thanks for your help!
  9. D

    bold line in auto email code

    Well just wrote my first html code... Thanks Chris. Only problem is it changed to Times New Roman font, any idea to how to get the font to Arial?
  10. D

    bold line in auto email code

    Hi, I'm trying to make a line of text in an email bold. I've searched heaps of other threads and found lots of info on it but still no luck. I've tried .fontbold = true and .bold = true. I want to make the line that contains SigFname and SigSName bold and all other texts normal. MyMail.Body...
  11. D

    Dcount records by date

    Thanks, I've been looking for a link like that to explain the apostrophes however, ive tried a few different variations and am winding up with either #error or 0 as the result. =DCount("[id]","[qrysso]","[ssoyear]= '" & Year(DateAdd("m",-1,Date())) & "' And [ssomonth]= '" &...
  12. D

    Dcount records by date

    ok i've changed the names of the fields. They are formatted date fields from a query - SSOMonth: Format([SSODate],"mmm") and SSOYear: Format([SSOYear],"yyyy")
  13. D

    Dcount records by date

    No good... get #Error message
  14. D

    Dcount records by date

    Can someone give me a hand with this one... Not sure where my speech marks should be? =DCount("[id]","[qrysso]","[Month]=" & Month(DateAdd("m",-1,Date())) And "[Year]=" & Year(DateAdd("m",-1,Date()))) Cheers
  15. D

    Problem with Date format

    Hi I'm trying to do a Dcount on one of my tables but am having issues with date conversion from US to European. I'm running off dd/mm/yyyy everywhere else and this is the first time ive had a problem. The Dcount works fine if the DD is greater then 12 but if the DD is equal to or less then 12...
  16. D

    mymail.subject error

    I'ts a beautiful thing! Thanks for your help.
  17. D

    mymail.subject error

    Thanks for your reply. How would i capture the item data into a variable? Public Function LRAuditMail() Dim db As DAO.Database Dim MailList As DAO.Recordset Dim MyOutlook As Outlook.Application Dim MyMail As Outlook.MailItem Dim Subjectline As String Dim BodyFile As String Dim SubmitDate As...
  18. D

    mymail.subject error

    Hi, I'm trying to setup and email to automatically send on a specific date each month. Tehn once the email sends i want to log it in a table that ive created. I've got the email to send alright but once i get to the logging part i get an error on mymail.subject - "The item has been moved or...
  19. D

    dsum calculated criteria

    The formatting is done in a different query i.e. QrySpend What do you mean reference the control of cmsref? I've tweaked the code a little bit... FYTDSpend: DSum("[totalspend]","QrySpend","QrySpend.[cmsref] = '" & [tblcontract].[cmsref] & "'" & " And year(QrySpend.[FisYear]) = #" &...
  20. D

    dsum calculated criteria

    FisYear is a date formatted as a year. Yep that worked however ive realised that ive got to have two criterias similar to below. DSum("[totalspend]","[Qryspend]","[FisYear]=" & Year(DateAdd("m",6,Date())) And "[qryspend].[cmsref]=" & [tblcontract].[cmsref]) Thanks
Back
Top Bottom