Recent content by LemonTwist

  1. L

    VBA module to import data from a specific Excel workbook tab

    I'm trying to write an Access VBA module which imports data from several Excel files. I'm using the DoCmd.TransferSpreadsheet command like this: DoCmd.TransferSpreadsheet _ acImport, _ acSpreadsheetTypeExcel5, _ "Table Name", _ Path & "Excel...
  2. L

    Problem with setting criteria on datetime value

    I've just tried that and unfortunately I still get the same error, but thanks for the suggestion anyway. Funnily enough, I just spoke to a co-worker and when he runs the exact same query every morning, he doesn't get the error message and the data still turns out correct in the end. Access is...
  3. L

    Problem with setting criteria on datetime value

    I am trying to add criteria to a date column on my Access query so that it only returns records from between 45 days ago and today's date. In the Criteria box for the date column I have put Between Date()-45 And Date() but when I try to run the query, I get an error message saying "ODBC Call...
  4. L

    Problem with query containing date criteria

    I did think about that, but when I tried it I just got an error. I think it's because I'm using parameters rather than actual dates in the query.
  5. L

    Problem with query containing date criteria

    I am stuck on a make-table query which involves date criteria. When I try to run the query, I get an error message saying "ODBC call failed. [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting datetime from character string. (#241)." In my query design view, there are 2...
  6. L

    Using VBA to change the datatype of a column

    Thanks for your help. In the end, I decided to use ALTER TABLE statements. Previously, the user of the database was having to manually change the data types of the columns (by going into Design view) every time they wanted to run the report. Once I had created the ALTER TABLE statements, I...
  7. L

    Using VBA to change the datatype of a column

    I need to automatically change the datatype of one of the columns in an Access table from Binary to Number using VBA. I tried using the code below to do this but get the runtime error 3219: Invalid Operation. Is there any way I can do this? Public Sub ChangeColumnType() Dim db As...
Back
Top Bottom