Using data from cells in a Query to a MS Access Database

I need to use a MS Excel 2003 spreadsheet to perform a simple set of calcs. 
One piece of information I need is stored in an Access Database. 

If I could have, I would have converted the spreadsheet to an MS Access 
database and programmed the query to use information from text boxes. 
However, not all employees in the company have MS Access on their computer. 
So I need to use an external query in Excel to look at the MS Access Database.

I can do that pretty easily. The Query Wizard walks you right through it. 
However, I need to make it so that the criteria for the query is drawn from 
(2) cells on the spreadsheet. I tried to edit the query in order to input the 
cell locations but for some reason I cannot access the parameters. That 
option is grayed out.

In addition, I need this query to run every time the data in the cells is 
changed. How would I do that?

Can anyone help me?
 
DGreco
0
Utf
3/12/2010 2:11:02 PM
excel.programming 6508 articles. 2 followers. Follow

2 Replies
639 Views

Similar Articles

[PageSpeed] 28

hi
odd thing about MSQuery parameters. MS set it up so that you can't edit 
parameters unless you have parameters to edit. so you with have to set your 
parameters up first. do that in the MSQuery Dialog.
walk through the MSQ wizard. on the last dialog, click edit directly in MS 
Query.
The MSQ dialog will come up. on the tool bar, click cirtera(parameters.) 
enter your parameters(cirteria) and ok out. now right click the query data 
area. from the pop up, choose parameters.  in the parameters dialog, you have 
3 options. one of them is to get value from a cell. enter the cell address.

regards
FSt1

"DGreco" wrote:

> I need to use a MS Excel 2003 spreadsheet to perform a simple set of calcs. 
> One piece of information I need is stored in an Access Database. 
> 
> If I could have, I would have converted the spreadsheet to an MS Access 
> database and programmed the query to use information from text boxes. 
> However, not all employees in the company have MS Access on their computer. 
> So I need to use an external query in Excel to look at the MS Access Database.
> 
> I can do that pretty easily. The Query Wizard walks you right through it. 
> However, I need to make it so that the criteria for the query is drawn from 
> (2) cells on the spreadsheet. I tried to edit the query in order to input the 
> cell locations but for some reason I cannot access the parameters. That 
> option is grayed out.
> 
> In addition, I need this query to run every time the data in the cells is 
> changed. How would I do that?
> 
> Can anyone help me?
>  
> DGreco
0
Utf
3/12/2010 3:01:03 PM
OK, I tried what you had suggested and still could not edit the parameters.

I use Data-->Iport External Data --->New Database Query

I then select "MS Access Database" and then browse to the location of my 
Access database and select it.

The Query Wizard starts and asks me to select the table and the choose the 
columns. No problem there. I find the table I want an them use the ">" to 
bring in all the columns

I did put in any filters because it won't allow me to enter in the cell 
location yet.  Fast forward to the end of the wizard where I'm in the 
"Microsoft Query" window and allowed to add criteria. At this point I would 
assume that  this is where I can insert the cell locations. No such luck. The 
values button only allows you to input values from the table.

Even after inputting some dummy criteria it does not allow you to set the 
value in a cell as a criteria.

Any help here? Does the fact that I'm using MS Excel 2003 have anything to 
do with it?

-- 
DGreco


"FSt1" wrote:

> hi
> odd thing about MSQuery parameters. MS set it up so that you can't edit 
> parameters unless you have parameters to edit. so you with have to set your 
> parameters up first. do that in the MSQuery Dialog.
> walk through the MSQ wizard. on the last dialog, click edit directly in MS 
> Query.
> The MSQ dialog will come up. on the tool bar, click cirtera(parameters.) 
> enter your parameters(cirteria) and ok out. now right click the query data 
> area. from the pop up, choose parameters.  in the parameters dialog, you have 
> 3 options. one of them is to get value from a cell. enter the cell address.
> 
> regards
> FSt1
> 
> "DGreco" wrote:
> 
> > I need to use a MS Excel 2003 spreadsheet to perform a simple set of calcs. 
> > One piece of information I need is stored in an Access Database. 
> > 
> > If I could have, I would have converted the spreadsheet to an MS Access 
> > database and programmed the query to use information from text boxes. 
> > However, not all employees in the company have MS Access on their computer. 
> > So I need to use an external query in Excel to look at the MS Access Database.
> > 
> > I can do that pretty easily. The Query Wizard walks you right through it. 
> > However, I need to make it so that the criteria for the query is drawn from 
> > (2) cells on the spreadsheet. I tried to edit the query in order to input the 
> > cell locations but for some reason I cannot access the parameters. That 
> > option is grayed out.
> > 
> > In addition, I need this query to run every time the data in the cells is 
> > changed. How would I do that?
> > 
> > Can anyone help me?
> >  
> > DGreco
0
Utf
3/16/2010 7:44:01 PM
Reply:

Similar Artilces:

Highlighting cells #2
Excel 2007 sp1 with vista 32 business sp1 Background: When you highlight multiple non-contigious cells (i.e. hold the control key down and select several cells that are not connected) Excel highlights the selected cells in light blue. Problem: This light blue does not show at all on many projectors. In some case you can adjust the color temp and this helps. We do hundreds of presentation in North America each year and can not control what projection equipment we will be using. Requested solution: I would change the light blue background that is applied to selected cells to some other colo...

Excel not Access
I have designed an Access database that holds records relating to my stores audit results going back for about 5 years plus a load more information relating to these stores. This was used to produe a pack once a month, however a change in senior management means that I have got to shelve this and prodce a similar pack in Excel. The idea would be that the user could select a month or a 12 mnth date range that would produce data that could then be used to populate a number of excel templates that have been designed. Having not used excel for years I would be grateful for any suggestion...

move cell contents
Is there a way to move a cell contents to another cell with a formula. ex: if a5="Name" then move g5 to j5? Also, I am using =INDEX(Sheet1!B3:B12,INT((RAND()*10)+1),1) to pick random names from a list. I have the formula in different place pick random names from different list. This does work, but I have different list with some of the same names and with the random pick I do not want the same name to appear. -- Thanks for any and all help. Davidl Hi David a formula can only affect the cell it is in, it can't move or change another cell for this you need some code ...

Password Issue with MS Money 2003
Hello, I am not familiar with newsgroups but I hope it is a forum to seek assistance. I am unable to reach MS support via email from my home computer on this issue. My Money 2003 requires a net passport password to open my account in Money that I have successfully accessed for approximately 12 months. It does not recognize my password now. I have attempted several times with my existing password, changed my net passport password, even uninstalled and re- installed MS Money 2003 to gain access to my account. Nothing has worked. Each time it states I have failed to enter the corr...

MS Money 95 data files
I hope that some one can answer this for me. I have used MS Money 95 for years, and it works just fine for me on Windows XP, however, I now have to reformat my hard drive, and have discovered that I can nolonger find my original install disk. Will the latest versions of Money still read the MS Money 95 data files. All that I have ever used the program for is to track my investments, and am unlikely to do any different in the future. Thanks Stan B In microsoft.public.money, Stan Banner wrote: >I hope that some one can answer this for me. >I have used MS Money 95 for years, and...

if cell starts with characters formula
Hi I need to count cells in a column starting with certain characters. each cell's data varies in length. I have tried with @countif( but does not work if the cell contains other characters after the "prefix". eg. row 20 cell 5 apples row 21 cell 5 apples red row 22 cell 5 apples green row 23 cell 5 plums green row 23 cell 5 plums purple totals required for apples = 3 (regardless of colour) total required for plums = 2 (regardless of colour) @countif(C20:c30,"plums") gives answer of 1 require answer of 2 @countif(C20:c30,&quo...

Compare records in a query then write equation??
Hi all, i have a problem and i need help, the case is as follows: the default rule is that i have 4 fields, (Date, Team, Score). each team is allowed to have one score per day but sometimes it can have 2 scores per day, when this is the case i wanna multiply each score by a certain number and have one score instead of 2 scores (similar to average but not average). So, i need to have a condition which compares records, and if this is the case, formulates this equation and gives me one score instead of 2 scores. Please help SELECT Team, [Date], Sum(Score)/Count(Score) * IIF(Count(Score) =1,1,S...

Using expression builder object
Hi, I'm developing a wizzard in Access which builds import templates for various data sources to a fixed set of tables. In step 3 the users must be able to build an expression ; for instance Left([Fieldx],20) . Now I would like to have a command button on my form which calls the Access expression builder to allow the users to use this to build the expression. This expression will then be stored in a text box linked to the templates table. Anybody know how to call and use this object from VBA code? -- Kind regards Noëlla DoCmd.RunCommand acCmdInvokeBuilder I th...

Transferring over outlook data to new XP machine
How do I transfer over my old emails, address book to my new XP machine? I have looked over the internet and found nothing the tells me EXACTLY how to do this, any help would be greatly appreciated. senior_tech@yahoo.com If your using MS Outlook copy your .PST file across and import it into the new install. >If your using MS Outlook copy your .PST file across and import it into the new install. No, don't import it. Simply use "File">"Open" -- Brian Tillman Smiths Aerospace 3290 Patterson Ave. SE, MS 1B3 Grand Rapids, MI 49512-1991 Brian.Tillman is the nam...

data input in text box
We have a form which the operator enters data in a text box. Currently we have a 'done' button on the form that the operator clicks to send the text box info to a vba program. How can we send the text box info to the vba program when the operator hits the enter key @ the end of the data entry for the text box? TIA -- _______________________________ In Christ's matchless name ted & colleen n6trf kc6rue Use the control's AfterUpdate event. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "ted" <n6trf@arr...

Using part of a cell in a chart title
I have a chart which should get a title. However, this should be partly be used from a cell e.g. "counted with 5%" 5% should be taken from the cell and used in the title. Is this possible? Hi, Yes it's possible but all of the chart title needs to be in the cell. So you may need to use a helper cell and concatenate text and value. http://www.andypope.info/tips/tip001.htm Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Nicole" <Nicole@discussions.microsoft.com> wrote in message news:5CB7A971-AA7F-4C34-BB42-7DC283AA2958@micro...

Input Excel 'Password to Open' through control in access form
Hi All, We know,Excel has prompt password to open it files. Is it possible to create a code that can supplies the excel prompt password?.So that when we open the excel file through our access control in a form, the excel files can be opened automatically.But when the excel files opened from its default icon,it will prompt a password first. ...

visible cell only
I'd like to use the PERCENTILE function in a list that has been autofiltered and get the results based only on the visible cells. I've used SUBTOTAL in order to get count, average, min and max. But I need to get the .25 and .75 percentile figures for the filtered data (visible cells only). I've scoured these forums. I've scoured the web. I've found some vba code that was supposed to select only visible cells but it doesn't work for me. I posted last week in the programming section of these forums (and again this morning) but got no reply. I figure...

Parsing data from one spreadsheet into another format
The data that we dump out of one machine comes in like below. %AT_1300 Bottoms|Conductivity| (Water Out) InputRange VDC1to5 %AT_1300 Bottoms|Conductivity| (Water Out) Custom_Range_Low 0.0 %AT_1300 Bottoms|Conductivity| (Water Out) Custom_Range_Hi 0.0 %AT_1300 Bottoms|Conductivity| (Water Out) MinScale 0.0 %AT_1300 Bottoms|Conductivity| (Water Out) MaxScale 20.0 %AT_1300 Bottoms|Conductivity| (Water Out) EngUnits mhos %AT_1300 Bottoms|Conductivity| (Water Out) StepResponseTime 1.0 %AT_1300 Bottoms|Conductivity| (Water Out) DigFiltTimeCnst 0.016 And I need to convert this data to this f...

what's the formula for adding symbols in cells?
I have a chart that has blank info in the legend. I want to add an * to indicate something, but just inserting a symbol doesn't work. Any ideas? Thanks. Debi - To add information to the legend, you need to add to a series name. Right click on the chart, select Source Data from the pop up menu, click on the series tab, select a series, and either type something in the name box, or click in it and select a cell with the mouse. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ Debi wrote: > I have a chart tha...

Sorting Data #5
Is there formula or anyway to be able sort the below data into a format that I could create a pivot table on? I spend to many hours doing this every month. Invoice #: 12345 Invoice Date: 1/16/1950 A/P Code: ABC Due Date: 1/16/1950 Total Payable: $100.00 Reference: Freight: Account #: 1234 Description: Name Reference 1 Amount: $100.00 Account #: 4321 Description: Name Reference 2 Amount: $100.00 Account #: 9876 Description: Name Reference 3 Amount: $100.00 Any help would be much appreciated!! You need to show a Before and After version. You still might not get any help, but your ...

adding name /creating field/query?
Hello, I can create an invoice_number field in a query using the primary field ID from the main table as invoice_number: ID but if ID say is 100, I cannot work out how to create renewal_invoice_100 Cheers Geoff Geoff We aren't there. We can't see what you're looking at. Where did "renewal_invoice_100" come from and what does it mean? Please post the SQL statement of the query you are trying to use. -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://micro...

How do I use traffic lights in excel
I am wanting to use traffic lights in excel that change colour based on the result of a variance cell, ie if the result of the cell is 10 make the traffic light green, if it is 20 make the traffic light amber, if the result is 30 make the traffic light red. How do I do this? Shorty Format>Conditional Formatting>Cell Value is: Note: you can add up to 3 conditions(4 if you count default) Gord Dibben Excel MVP On Wed, 22 Dec 2004 16:35:03 -0800, Shorty <Shorty@discussions.microsoft.com> wrote: >I am wanting to use traffic lights in excel that change colour based on the &g...

How To Copy MS Word mailing labels into Excel
I have a word doc that I want to put into Excel. I want to add some more fields to the names and addresses. Is this simple or do I have to learn how to program? Michael Rodriguez City of Grand Prairie Michael, have you tried to copy and paste the data into excel? -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Michael Rodriguez" <mrodrigu@gptx.org> wrote in messa...

Filter recordset using query results
Hi all I have a form based on a query called [qry Quarterly Planning], it lists all Itineraries on the system. On this form you can filter records by specifying a Start and End Date for the [ReviewDate] and/or [Specialist]. It is a subform on a main unbound form, lets call this Subform1. Along side this I have another subform (Subform2) which displays ReviewDates that exist against an Itinerary. In other words Subform1 has a start date of an activity and if the activity lasts longer than 1 day, then the additional dates are stored in Subform2 (ItineraryDates). Currently when I...

Radar chart in Access 2007 report
Can you add a Radar chart to an access 2207 report? ...

HELP! Need to export hourly sales data on POS (NOT RMS)
How can I export hourly sales data across a date range? For instance, I want to show hourly sales for the month of October so I can graph it and post it in our break room. If I can't export hourly data, can I export daily sales? The built-in reports don't address this data format. This is a multi-part message in MIME format. ------=_NextPart_000_008E_01C826DC.CBC512D0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit Mark, This should work for you. Keep in mind it takes up to 5-10 minutes to load...

"MS Money 2000" mit kostenlosem HBCI-Modul (HBCIFM99) kompatibel?
Hallo, Gruppe, wollte mal fragen, ob das o. g. HBCI-Modul auch mit "MS Money 2000" (also - wenn ich das richtig verstanden habe - mit der letzten deutschen Version von "MS Money" 1999/2000 aus �sterreich/der Schweiz) kompatibel ist. Vielen Dank schon im voraus f�r Eure Hilfe. Gru� Struppi Roughly translated: ------------------------- Hello, Group, I wanted to ask whether the o. g. HBCI module also with "MS Money 2000" (also - if I understood correctly that - with the last German version of "MS Money" 1999/2000 from Austria/Switzerland) is compatib...

Strange Access Denied Problem with Windows 7
I got a new computer about six months ago that came with Windows Vista Home Premium 64bit. Before that I had done all of my .NET development either on an XP Pro VM or my former XP Pro computer at home. Shortly after getting my new computer at home, I also got a license for VMWare to be able to test my software on multiple platforms and configurations. I had wrote an application originally in VB.NET that was a simple backup utility. It supports mutiple backup configurations. Any given copnfiguration would define a backup which would be a list of files to backup, a list of folders to ...

[b]Can I download Excel data to a MS Access database?[/b]
I've built an Excel 2002 form that I want our internal customers to access from our intranet, and use. Once completed, they will send it to us as an e-mail attachment. I'd like to be able to open it, and somehow download the data from the form into an MS Access 2002 database I've built (so that we don't have to rekey it into the database). Is this possible or even feasible? Any and all help is appreciated. Thanks. :D --------- Message sent via www.excelforums.com Hi in Access check 'File - Import External data' -- Regards Frank Kabel Frankfurt, Germany "...