Wrong data types when loading sql query with vba in excel

I have a SQL Query, which I want to use in VBA to load the data into Excel, the problem is that when the load is done the data in Excel is with the wrong type. For example, where it needs to be a date,…

Conditionally remove rows from ms access query (SQL)

I would like to remove rows (about 10000) from a report in ms access. I am comparing two sets of two column in a table. When I run the query I would like it to remove the rows where column 1 and 3 …

VBA SQL update/insert to local table using values from form

I am trying to update a row in a local table stored in access (or insert a new row if that ID doesn’t already exist) using values populated in a form by the user. I am writing it in VBA using SQL. …

‘CREATE TABLE’ generates Run-time error ‘3290’

I have a syntax issue in the first CREATE TABLE statement. I’m receiving the following VBA error: Run-time error ‘3290’ The goal is to move the distinct data to a new table dependent on values in …

Transfering Data with VBA(Excel) to SQL Server but avoiding duplicate column?

My main objective is to transfer some data from excel to SQL server while using vba but in the process I would like to detect and avoid transferring some duplicate month columns. This is what i have …

VBA Function/ Code – Convert Dynamic Column of Data into Text String

I’m creating a tool where users can query an ODBC through excel. I need a function which will look at a column of item id’s which the user has pasted in and then create a text string which can be used …

Error 424 object required after NULL SQL query

I am running some EXCEL VBA code to update the contents of an ACCESS database table along the lines suggested here: IF @@Rowcount = 0 — SQL Syntax Error in Access . When I execute the SELECT query, …

Carriage Return in Table Header

I’m writing an Excel macro to pull in data from another Workbook. I don’t have any control over that workbook, which is a shame because then I could fix this issue at source, as it is i have to work …

Adding quotes into a sql query with Vba code

I can recover data from my database using vba, but I have to add quotes on the result of column (“value1”, “Value2”, “Value3” etc) But I do not know how to add quotes inside the SQL query, when using “…

Multi-Field Search Button (Query) Showing Records With or Without Missing Fields

I have a database with only 1 table, this table has 27+ fields and not all of them will contain a value (some will be empty). I have a button (“search alarm”) on a navigation form that performs a …