This might be a help for getting data to and from Excel and Access: It
includes examples of using variables in SQL queries.
http://www.bygsoftware.com/examples/sql.html
Or you can get there from the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm
It demonstrates how to use SQL in Excel's VBA to:
* create a database,
* create a table
* insert records
* select records,
* update records,
* delete records,
* delete a table,
* delete a database.
DAO and ADO files available.
You can also download the demonstration file called "excelsql.zip".
The code is open and commented.
--
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
-
"Gentian Hila" wrote in message
...
Hi everyone,
I have a couple of users (management) that want to keep Excel for editing
data from a database.
How can I display the result of a query (table or view) from a SQL
database
to Excel?
I also would like that the database is updated when the user clicks save
on
excel.
I would appreciate any direction.
I have programmed quite a lot with vb.net and sql databases but I have
never
done VBA for Office programs however I know it is very similar, so if you
could point me out to a guide or tutorial, it will be very helpful.
Thanks
Gentian