Search results

  1. G

    Format within Query to 2 decimal places.

    When I typed "0.00" MS Access automatically changes to "#.000". Fortunately, I found useful for my project the format: "Standard" When I typed "Standard" and run the query it returns 1.080,00 and 8,00. Cheers
  2. G

    Format within Query to 2 decimal places.

    Hello. In a Union Query, I used Round([field],2) for every single query. However, when I run the union query shows the value as 1080 and I need 1.080,00 I already Format the query column with 2 in the decimal places How do I format the number to as I need? Thanks
  3. G

    Export query from ms access to excel and create chart

    June7, Cronk, JHB, Ranman256 For all of you, many thanks. Finally, I have a code to export and create a chart in excel. This is my code: ub cmdTransfer_Click() Dim sExcelWB As String Dim xl As Object ''Excel.Application Dim wb As Object ''Excel.Workbook Dim ws As Object ''Excel.Worksheet Dim ch...
  4. G

    Export query from ms access to excel and create chart

    June7. I will test the code. As soon as possible, I will let you know if I succeed. Also, I have been trying this line of code. Range("C2", range("D2").End(xlDown) However, I don't know what I have to write before Range. Thanks, again.
  5. G

    Export query from ms access to excel and create chart

    June7. Many thanks. I just tested this code and works fine: Set ws = wb.Sheets("qry_task") Range("C2").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select...
  6. G

    Export query from ms access to excel and create chart

    Cronk. Many thanks I'll keep your code lines. I see these are another ways to create a chart. Now, I'm focused on writing Range("C2:D" & i - 1) from the query to create the graph. I really appreciate your help.
  7. G

    Export query from ms access to excel and create chart

    June 7. Your code with my query works fine. Many thanks. In my database, I have a command button to export a query to Excel Worksheet and create a chart. Nevertheless, I need the chart data from query Range("C2:D" i-1). I have this code from excel: .SetSourceData Source:=xlSheet.Range("C2:D"...
  8. G

    Export query from ms access to excel and create chart

    Thanks to JHV, this line of code use all range of data from the query to insert the graph. DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_task", sExcelWB, True Set wb = xl.Workbooks.Open(sExcelWB) Set ws = wb.Sheets("qry_task") Set ch = xl.Charts.Add ch.ChartType =...
  9. G

    ERROR 3011 when exporting access qry to excel to create chart

    Cronk. You are right with the bad yellow colour, it is in my vba editor. I really apologize. Your code works perfectly. Thank you for your contribution. I have been googling for a code to export the query and the chart in one Sheet. Could anybody suggest me how to do it? Do I have to write a...
  10. G

    ERROR 3011 when exporting access qry to excel to create chart

    Mark I really appreciate your reply Well, I did your recommendation. The MsgBox is "Exporting to: D:\testing\01_08_2018 * 03_08_2018_85_qry_task.xls" I wrote the code using the Intellisense to check txt names. When I run the code VBE displays same Error 3011 I am working on a personal...
  11. G

    ERROR 3011 when exporting access qry to excel to create chart

    Hello I have a form with three txtboxes to query between dates, one to select Date1, other to select Date2, and another to type the value of a code. When exporting the file I need the file name as indicated in line "sExcelWB=.... dd_mm_yyyy_plot_qry_task.xls This is the code: Sub...
  12. G

    Export query from ms access to excel and create chart

    JHB The problem was ERROR 91. Now the Error is fixed The use of With is unnecessary 'With xl '.Workbooks.Open sExcelWB 'End With Thanks, again
  13. G

    Export query from ms access to excel and create chart

    Hello. The code works nice and now I see the chart in Sheet Chart and the query in Sheet qry_01. How can I do to display the Chart and the Query in the same sheet with the query name? I really appreciate your help.
  14. G

    Export query from ms access to excel and create chart

    Many thanks for your reply. I apologize. The Editor displays the ERROR 91 on the line: sExcelWB = "D:\testing\testchart.xlsx" On the other hand, when I add your code the editor displays this message: "Compilation Error variable not defined" I don't know what is pvfile and the type of variable...
  15. G

    Export query from ms access to excel and create chart

    Hello I am trying to run a code to access-query-to-excel-2010-to-create-a-graph-via-vba. However, anytime the editor displays ERROR 91.:confused: I cannot see the final product. Moreover, I need the query and the chart in the same worksheet and save the file. 'Any help is welcome. This is the...
  16. G

    exported query to excel with dates range file name

    BoBaxter. In my previous message, the access-programmers website didn´t allow to send the image that illustrates the error.
  17. G

    exported query to excel with dates range file name

    BoBaxter I ran the code you recommend me. However, anytime I enter the same date or different dates, vba displays error 13 in this line: If DateValue(Me.txtday1) = DateValue(Me.txtplot) Then I have been trying by my self to fix such error with no success.:confused: Could you suggest me how to...
  18. G

    exported query to excel with dates range file name

    Pat. As I am improving my knowledge in vba, your explanation is clear and very useful. Thank you very much
  19. G

    exported query to excel with dates range file name

    June7 and Mark. Many thanks for your reply and help. I attach the Database I am working. The code in Command Button "Export All to Excel" runs well The code in Command Button "Export All to Excel by Dates Range" runs well. However, I need the exported file name including the date range...
  20. G

    exported query to excel with dates range file name

    Gasman. Many thanks for your help. I tried this code but does not work. filename1 = "C:\Path" & Replace(Me.txtday1, "/", "_") & Replace(Me.txtplot, "/", "_" & "_") & "_"_"_qry_01.xlsx". Could you tell me what I am doing wrong?
Top Bottom