Search results

  1. K

    Pivot table export to Excel

    I am trying to export an Access pivot table (a pivot table view from a query) to Excel. Whenever I did this manually, the version that appeared in Excel was just the table, not the pivot table. So, I used the following VBA code: Private Sub ExportPivot_Click() DoCmd.OpenQuery "FileName "...
  2. K

    Add comparatives to grouped totals queries

    Thank you very much. That clears things up.
  3. K

    Add comparatives to grouped totals queries

    I have a totals query of phone call charges by phone number and I want to show a ‘budget’ amount for each number (same amount for all) and a variance against that budget. Could someone please advise how I can do this at the grouped (phone number) level rather than at the individual call level...
  4. K

    Problems with Replace function

    Thank you. I tried “###,###” (which was immediately converted to “#,###”) as well as “#,##0”. Both of these resulted in what seemed to be the required format e.g. 3,048. SELECT Call8PointInfoQry.電話番号(MSN), Sum(Call8PointInfoQry.PointsNumber) AS PointsNumberOfSum, Format([PointsNumber],"#,###")...
  5. K

    Problems with Replace function

    Thank you again, thechazm. format([Field], "000,000") unfortunately did not work. The results resorted back to the initial leading zero text formatting and gave results like: 020,450 I finally suppressed the parameter box (more by luck than judgement). However, there are a number of selections...
  6. K

    Problems with Replace function

    Thank you for the Quick reply. I clicked on the parameter button and there are no entries, so perhaps there is something wrong with my expression? When I use: PointsNumber: CLng([NewPoints]) I get the error message: 'The expression is typed incorrectly, or it is too complex to be evaluated…..’...
  7. K

    Problems with Replace function

    Thank you very much. As you said, there were null values in the field. I used the Nz(fieldname) and that worked. I do still have a couple of issues, though: 1. I am being prompted for parameter values for both the ‘Points’ and ‘NewPoints’ fields. Any input, including 1 letter makes this go away...
  8. K

    Problems with Replace function

    I have a field in an imported text file that should ideally be a number field but has preceding zeroes (e.g. 000000004800). I had to make this a text field on import as some of the fields have hyphens (-) in the middle (e.g. 0000000-9000), which meant that, if I selected a number data type...
  9. K

    Importing fixed width text file with VBA

    Thank you for the response. I went into the ‘advanced’ button and saved the spec. I then included that in my code: Private Sub ImportDataTest_Click() DoCmd.TransferText acImportFixed, "Call7CurrentFile Import Specification", "Call07urrentTbl", "Call7CurrentFile" DoCmd.Close End Sub However...
  10. K

    Importing fixed width text file with VBA

    Could someone please help? I am trying to attach a piece of code to a button on a form to import a fixed width text file with a saved import specification. Private Sub ImportDataTest_Click() DoCmd.TransferText acImportFixed, "Import-Call0CurrentCSV", "Call0CurrentTbl", "Call0CurrentFile"...
  11. K

    avoiding hard coding current directory file path

    Thank you - that works.
  12. K

    avoiding hard coding current directory file path

    I have a piece of code to open a Word document. I would like to use the ‘current project.path’ instead of hard coding the directory path but cannot seem to get the right code / syntax. Private Sub OpenWordDocument_Click() Dim oApp As Object Dim strDocName As String strDocName =...
  13. K

    Exporting query to Excel spreadsheet

    JHB, thanks for that. I added "10" as the spreadsheet type, which removed the error message but, unfortunately the spreadsheet did not seem to be exported. I found some code from one of the other threads and used that, which seems to have worked: Private Sub exportDataTest_Click() On Error...
  14. K

    Exporting query to Excel spreadsheet

    Hi all, I’m pretty new to this site – and to Access and VBA! I wanted to import an Excel file to a table in my Access database, which I (eventually) accomplished with very simple code in a class module: Private Sub ImportDataTest_Click() DoCmd.TransferSpreadsheet acImport, , "test", "Job...
  15. K

    Conflicting code?

    I am trying to use 2 simple pieces of code on the same form. They both work on their own but when combined in one form together, one is ignored. Could someone please tell me what’s wrong? I initially added the code to change the back colour and add a message when a record was being edited...
  16. K

    Queries not picking up newly added records

    Hi Galaxiom, That worked a treat! Thank you very much! I appreciate your prompt help! Have a good evening.
  17. K

    Queries not picking up newly added records

    Thank you I'll try that!
  18. K

    Queries not picking up newly added records

    Thank you. I think I understand what you say. The query is as follows: SELECT Nz([JobDetail].[Date],"") AS [Date], Nz([Source].[Source],"") AS Source, Nz([Region].[Region],"") AS Region, Nz([JobDetail].[Ref],"") AS Reference, Nz([JobDetail].[Position],"") AS [Position]...
  19. K

    Queries not picking up newly added records

    In a table on which the query is based.
  20. K

    Queries not picking up newly added records

    Hi all. New member here – I hope I’m not breaking any etiquette or protocol rules! Only recently started to get to grips with Access (with the help of ‘The Missing Manual’ and some online resources). Usually I can find answers to my Access problems by searching other people’s questions. On this...
Back
Top Bottom