LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
RTP RTP is offline
external usenet poster
 
Posts: 4
Default Get external data from MS Access using variables

I am trying to import external data into Excel from Access using the database
query technique. I have recorded a macro that pulls in data based on
specific criteria, the following is the criteria I have used:


"WHERE (Access_data.NAME='Mr Smith') AND " , "(Access_data.LOCATION='UK')")

This works sucessfully (and returns four records) but what I need to do is
replace the 'hard coded' criteria with varaibles, like this:

v_name = "Mr Smith"
v_loc = "UK"

"WHERE (Access_data.NAME=v_name AND " , "(Access_data.LOCATION=v_loc)")

This method does not return any records becasue I am using variables. If I
hard-code the variables the query works.

How can I successfully get external data from an Access database using
variables as selection criteria?

Thanks
RTP
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get External Data from Access Parameter Query NewUser Excel Discussion (Misc queries) 0 December 1st 07 03:24 AM
MONTHNAME when getting external data from Access -PJ Excel Worksheet Functions 2 June 30th 06 08:50 PM
Retrieving External Data from Access into Excel Vicki Excel Programming 1 May 26th 04 09:20 AM
Retrieving External Data from Access Vicki Excel Programming 0 May 26th 04 01:16 AM
external data access problem Gary Desroches Excel Programming 1 August 1st 03 12:29 AM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"