How do I use an Excel cell value as a where criteria in a word da.

L

London257

Hi, I am trying to retrieve data from an access 2003 database into a Word
2003 document based on the value in a cell in an Excel spreadsheet.

The following SQL statement retrieves the text in the 'Reading' field of my
chinese horoscope Readings database but I want the values of
'Reading.Palace', 'Reading.Star' and 'Reading.OtherStars' to equal text in
cells in an Excel 2003 spreadsheet rather than manually typed in. The values
of the Excel cells are text and they change based on an individuals date of
birth.

SELECT DISTINCT Readings.Reading
FROM Readings Readings
WHERE (Readings.Palace='Brothers & Sisters') AND (Readings.Star='Chi Sha')
AND (Readings.OtherStars='Any')

Any ideas? all help gratefully received. Geoff.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TG9uZG9uMjU3?=,

Since your question mainly deals with how to extract information from an Excel
sheet for an SQL query for Access, I suggest you ask this in an Excel or Access
newsgroup.

FWIW, you should be able to use DAO to access the data in the spreadsheet
without needing to automate Excel (IOW, with the file closed). But in order to
get any help on this, you should also mention how the cells containing the text
you want to retrieve may be identified. Best would certainly be to use range
names...
The following SQL statement retrieves the text in the 'Reading' field of my
chinese horoscope Readings database but I want the values of
'Reading.Palace', 'Reading.Star' and 'Reading.OtherStars' to equal text in
cells in an Excel 2003 spreadsheet rather than manually typed in. The values
of the Excel cells are text and they change based on an individuals date of
birth.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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