• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA, Query Tool, Excel

dan_l

Active Member
The backstory:


I've got a bad customer contact database. I mean real bad. I mean we're talking it hurts your soul to use it bad. Like all bad database, it has this hard to use, watered down, toothless reporting system that nobody uses because it's so difficult for 'non-computer people' to figure out and for people who know a lil bit about a lil bit, it raises your blood pressure by about 12 points and accelerates hair loss.


Being me, I clicky clicky'd and realized that I can go after the data using excel's onboard query tool via an ODBC thing. Thus far, it's worked out ok. I've been able to safely distribute .dqy files to certain constituents who can just double click it, get the data they need and be done with it. Ad hoc needs have largely fallen on my desk. But it's gotta change! So I've been told.


So obviously, distributing a bunch of generic .dqy files with a bunch of where table.field like '%%' isn't practical - which isn't to say I haven't tried it---I'm just sayin: it's not for everybody. So here's what I want to do:


I want to make some VBA hawtness in the form of an add in that will:

1. Put a menu somewhere up in file>edit>view

2. Allow for a user to select one of the reports and be prompted to input certain variables like dates or names and have that data be passed to the query


The catch is, I haven't the slightest idea where to start. My VBA knowledge is pretty limited.


Does anybody have a clue as how to get this going? Or know of a resource where this sort of thing is described?
 
Here's a start:

(I'm answering my own question)


1. From the query tool, add a criteria field

2. Under criteria, put a prompt in [] brackets.


So, in my case I'm doing the status field. After adding table.status, I put:


[Enter status] in the criteria. When a consumer launches the query, excel brings up a dialog box for "enter status". It's still unclear whether I can make this into a like statement, but I'm going to play with it and see what happens.
 
Back
Top