J
Reaction score
23

Profile posts Latest activity Postings About

  • jz, would you mind helping me on some code for exporting a report to a excel template? You are the only person on here that I think is the best.. Here is the code that I have but its not working. Any help would be greatly appreciated Thank you

    Dim db As DAO.Database
    Dim rs As DAO.Recordset

    Set db = CurrentDb
    Set rs = db.OpenRecordset("[rptcslw/selectionsbyworkitem]", dbOpenDynaset)

    'Create a new workbook in Excel
    Dim oExcel As Object
    Dim oBook As Object
    Dim oSheet As Object
    Set oExcel = CreateObject("Excel.Application")
    Set oBook = oExcel.Workbooks.Add
    Set oSheet = oBook.Worksheets(1)

    'Transfer the data to Excel
    oSheet.Range("A4").CopyFromRecordset rs

    'Save the Workbook and Quit Excel
    oBook.SaveAs "C:\users\lowana.hernandez\csl"
    oExcel.Quit

    'Close the connection
    Set rs = Nothing
    Set db = Nothing
    jz, would you mind if I sent you my db, maybe it will give you a better understanding of what I am trying to do. It is far too large to post in the thread. I would have to send it via email. Let me know. Dave
    you are the most helpful & knowledgeable person I have come across on this forum. You helped me a few months back with a db. I am wondering if you can help with vba code that will change criteria in a query qryComparisionSheet by discipline then open rptComparisionSheet when it is selected from a drop down menu...let me know if i make sense.. dont understand what another person on here is trying to tell me... thank u in advance a sample db is posted here http://www.access-programmers.co.uk/forums/showthread.php?p=1195714#post1195714 password: LOCK
    Jz, I am having a heck of a time with a query. Do you think you could hop over to this post and see if you have anything to offer? I've tried stringing together 3 queries but the problem i'm having is that some days for each department do not have employees with days off. And as such they are not showing in the 2 step query. I tried this formula but it is causing duplicates. IIf(qryDeptbyDay_2ndQuery.[Scheduled for Dept by Day]=Null,qryCountbyDept.CountOfpkEmployeeID,qryDeptbyDay_2ndQuery.[Scheduled for Dept by Day])

    http://www.access-programmers.co.uk/forums/showthread.php?t=213996
    Thank you so much for all the help you gave me with the problems I came across in building my database, I really appreciate you taking the time to help find a solution! Helped me learn a lot on top of just applying a solution so thank you.

    Si
    I hope you had a wonderful summer, I do have one question you worked with my on my work db and everything has been going well until I went to enter in dates for the dte Evaluation and Basic. It keeps giving me the value you entered isn't valid for this field error and I cannot enter in anything into the field.
    Wow...thank you for your help! You totally saved me on that one...It's been a few years since I did vb and now I just started working with a new company. I really appreciate the help! Take Care!
  • Loading…
  • Loading…
  • Loading…
Top Bottom