Search results

  1. K

    Problem creating a form from multiple tables

    I am trying to create an input form for input to tables. There is a main ‘TblContacts’ table with fields such as: ‘LastName’, ‘FirstName’, ‘Address’, etc. There are also ID fields for the Company and Country and joins to the ‘Company’ and ‘Country’ tables, each with just ID and name fields. I...
  2. K

    Poor query performance

    I have a selection of queries that are being run through a form after selection of 3 fields in combo boxes. One Totals query is extremely slow, taking several minutes for the selections in the combo boxes to become visible – especially for one of the combo boxes. The code is as follows...
  3. K

    Error message 3122. Problem using ‘sum’ on amount field in totals query

    I have a piece of code where I am selecting values for 3 of the fields through combo boxes to run a query. This works fine on a detailed query but I have problems when I try and amend the code to run a totals query. When I run the following query directly, there is no problem: SELECT...
  4. K

    Robust form input from joined tables

    I have a database with a main table, joined to a few other tables. The main table has 10 fields of which, initially, 4 had table level lookups on ID fields, pulling in the names (such as status and Region) from other tables. However, the more I played with advanced functionality, the more I...
  5. K

    Executing a query through a form

    I am trying to make selection on and run a query from a form and have plagiarised the following code: Private Sub cmdOK_Click() Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim strSQL As String Set db = CurrentDb Set qdf = db.QueryDefs("qryNewJobLocator") strSQL = "SELECT JobDetailNew.* " &...
  6. K

    Searching for teaching material / books on advanced SQL for Access

    Apologies if this is the wrong forum ….After a few months of grappling with Access, working through books and getting help on this site (and other internet resources), I’m finding that solving query problems is my main issue. Could somebody please recommend a good ‘Advanced SQL for Access’ book...
  7. K

    error message that “you tried to execute a query..."

    I have a query that shows all calls from corporate mobile phones and indicates whether the number called is also a company mobile or whether it is a number in one of the company offices. When I try to run a totals query based on this: SELECT Call0InternalSplit.Month, Call0InternalSplit.NrCalled...
  8. K

    Lookup question

    I have a table which includes corporate mobile phone numbers and the phone numbers that they dialed in each call. I want to notate whether the number called is another company mobile i.e. contained in the field of company mobiles) or an external number but I don’t know how to do this. Cold...
  9. K

    Question re error handling code

    I have a very simple piece of code which deletes the import error tables for 6 file imports. Private Sub DeleteImportErrorTables_Click() 'Delete the import error tables for those created due to header row. DoCmd.DeleteObject acTable, "Call0CurrentFile_ImportErrors" DoCmd.DeleteObject acTable...
  10. K

    How to join tables with no matching, unique fields

    I am undertaking an analysis of corporate mobile phone data based on data from the phone provider. The base data consists of a number of monthly text files at transaction level for voice calls, data usage, billing/tariff information, international calls/transfers etc. I have set up VBA code to...
  11. 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 "...
  12. 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...
  13. 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...
  14. 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"...
  15. 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 =...
  16. 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...
  17. 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...
  18. 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...
  19. K

    Queries not picking up newly added rows in tables

    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...
Top Bottom