LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 210
Default Run query to get data from Access based on user input

I have an Access database (MIP_MCC_Review.mdb) with two tables (MCC and MIP)
that contain data submitted by users using forms of the same names. I have a
query that I built in Excel Microsoft Query that will get specific data
(rows) from the tables in Access and import that data into Excel in a new
worksheet of a workbook that I use (MCC_MIP_Review.xls) for calculations on
the data. I wrote a macro that will create the new worksheet (MIP_Data) and
that works fine. What I want to do now is to modify the same macro to launch
a form I created (dialog box) with one text box and an OK button so the user
can enter a five character string that will determine what specific rows to
get from the database. Once the user enters the search string and clicks OK,
I want to change the SQL "Where" statement to what the user entered in the
dialog box. In other words, my SQL Select statement is WHERE (MIP.`Employee
SEID`='DK8FB'), and based on what the user entered into the dialog box, I
want to change it to WHERE (MIP.`Employee SEID`='HF5JK'), if HF5JK was what
the user entered. Is it possible to change SQL statements based on user input
from a dialog box? If so, how would I do that all in the same macro? Any
assistance would be appreciated.
 
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
Extracting Data from another worksheet based on user input Alvyn Excel Worksheet Functions 14 August 6th 08 05:41 PM
Incrementing Data based on user input learningaccess Excel Discussion (Misc queries) 3 January 26th 07 03:28 PM
Copy cell data from workbook based on user input Michael A Excel Programming 7 December 31st 05 03:07 PM
Rollup of Data in Multiple Sheets (based on user input) Gauthier Excel Programming 1 December 10th 03 12:55 PM
select data based on user input Dave Ramage[_2_] Excel Programming 0 July 28th 03 12:50 PM


All times are GMT +1. The time now is 08:53 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"