SQL.REQUEST help needed

M

mr.bungle

Having trouble trying to pull info into Excel from an Access table.

The last element of the SQL.REQUEST function is SELECT Client FROM
tblProject WHERE (ProjectRef=$A$1)

When $A$1 is an integer the function works ok, but I can't get it to
look for a text string. Is this a limitation of the function?

Any help appreciated.

mrb.
 
A

Alok

When the field in access is a text field, you have to encolse the value in
single or double quotes as follows
tblProject WHERE (ProjectRef= & chr(34) & $A$1 & chr(34))
Note chr(34) is equivalent to a double quote.
Alok
 
A

Andy Wiggins

This file gives general help on the use of SQL.REQUEST. It might help:
http://www.bygsoftware.com/examples/zipfiles/UsingSqlRequest.zip
It's in the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm

This workbook demonstrates how to get data direct from an MS Access table,
or from an open or closed MS Excel workbook using the workbook function
SQL.REQUEST.

Recently updated to show the use of SQL.REQUEST in the same workbook.

The code is open and commented.


--
Regards
-
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top