Search results

  1. D

    Solved Lopping through a query to export separate Excel files

    Hi, I have the following code to export a query result to Excel. Dim db As DAO.Database Dim rs As Recordset Set db = CurrentDb Dim mySql As String Dim MYPath As String Dim Country As String mySql = "SELECT * From QryMissingData" Country = DLookup("Country", "tblCountries", "CountryCode = 1")...
  2. D

    Solved Importing Multiple Excel Files

    Sorry. Still have the learner plates on!
  3. D

    Solved Importing Multiple Excel Files

    Thank you all. When I included the has field names as true it worked perfectly. Really appreciate the assistance from everyone!
  4. D

    Solved Importing Multiple Excel Files

    The first file in the directory, Argentina Data.xlsx
  5. D

    Solved Importing Multiple Excel Files

    Yes, all sheets contain the same headings. The code runs to the breakpoint.
  6. D

    Solved Importing Multiple Excel Files

    Thanks for this. Much appreciated. When I run the code, I encounter the error "Field 'F 1' does not exist in destination table "tblConsolRawData". There are 19 fields in each of the spreadsheets and my field names in my table correspond to these. I have tried a couple of things to test this...
  7. D

    Solved Importing Multiple Excel Files

    Thanks for that. Now I am getting an "invalid procedure call or argument error" at myfile = Dir() Thanks
  8. D

    Solved Importing Multiple Excel Files

    Hi I need to import over 20 excel files into one table in a new project. I have found the following code to do this: Public Function Impo_allExcel() Dim myfile Dim mypath mypath = "C:\KPMG\Country_Data" ChDir (mypath) myfile = Dir() Do While myfile <> "" If myfile Like "*.xlsx" Then...
  9. D

    Replacing Run time error 3022

    Thank you everyone for your insights! I did have the OnError code in the incorrect place, that is after the error occurred. When I corrected this it worked perfectly! In regard to the unbound form, I use this as some of the data is used to update other tables as well. Many thanks again
  10. D

    Replacing Run time error 3022

    Thanks The_Doc_man I inserted your code after the end with statement and it is still not trapping the error. The system error still appears.
  11. D

    Replacing Run time error 3022

    Thanks It is Set DB = CurrentDb Set rst = DB.OpenRecordset("tblExpensesTesting") With rst .AddNew !DateAdded = Now() !ExpMonth = ExpMonth !ExpYear = MyYear ![Bank Fees] = Me.txtBankFees !Cleaning = Me.txtCleaning ![Consulting and Accounting] = Me.txtConsulting...
  12. D

    Replacing Run time error 3022

    Hi I have an unbound form which adds records to a table with a unique index based on the Month and Year (expmonth and expyear respectively) When I attempt to add a record that violates the index rules, I receive error 3022 which is exactly what it should do. What I am trying to do is replace...
  13. D

    Object Required - Linked Table

    Thank you. It was the dot in rst.tblgst that was the issue. My bad!
  14. D

    Object Required - Linked Table

    Hi I have a back end on another computer which in the main works fine. I have however one linked table which I cannot update. My function is Public Function AddToGSTAccount() Dim dbsPaymentsDue As Database Set dbsPaymentsDue = CurrentDb Set rstTblPaymentsDue =...
  15. D

    Dcount Multiple Criteria Syntax

    Thank you. Works perfectly. I have googled this many times without success. Is there a reference point where I can learn this?
  16. D

    Dcount Multiple Criteria Syntax

    Hi Could someone please help me with this. I have tried so many variations with syntax and just cannot get it right! My stripped down Dcount statement looks like: RecordExists = Dcount("ID","tblStockOut",StockItem = & StockItem & and Quantity = & Quantity & and Date = & ThisDate &) Where all...
  17. D

    Windows 11 Home Date Issues

    Thank you all It turned out to be a difference in the short date settings which I had previously overlooked. Appreciate your help!
  18. D

    Windows 11 Home Date Issues

    Thanks. I have done that and they are identical.
  19. D

    Windows 11 Home Date Issues

    Hi I have an Access app which runs perfectly on my laptop, running Windows 11s. I have purchased a Surface Pro 8, running Widows 11 Home. I have copied the front end of my app to the Surface Pro and linked the tables to the Back End on my laptop. I am now getting erratic errors in my app on...
  20. D

    Last Friday in Each Month

    I want to pass a date to the function. I am creating a payments due table and one of the payment frequencies is the last Friday of each month.
Back
Top Bottom