Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass User value in SQL Query

Status
Not open for further replies.

Hap007

MIS
Mar 21, 2003
1,018
US
I am trying to setup a SQL Query to pick a group of records.

What I have been asked to do is create a query that when run, prompts the user for a value and then uses that value as part of the 'Where' condition to select the records.

Example might be Where State = 'TX'

But my user wants to be prompted for the value 'TX' or the like.

I know that I can hardcode many queries each for a different state, but my user wants to run the query and be prompted.

Note: The actual field they want to select on is a User defined field that has 100's of possiblities, so a query for each possible value is not what they want.

Anybody able to do something like this.

Thanks,
Hap...

Access Developer [pc] Access based Add-on Solutions
Access Consultants forum
 
Well, I've done something like this in my SuperSearch application... It also touches on your other question with regards to having an external program manipulate GoldMine to move it to a specific contact record... It's freeware, check it out here:

The building of the query wasn't too tough, really.. It was just a matter of using various string methods to trim off spaces and such and then add it together with "Select * from contact1 where ", etc. Then you issue that query via ADO or whatever method you're using. There's a handy datastream method that allows you to pass queries of this nature to GoldMine's DLL and receive the results -- it's what I use in my SuperSearch program) that would probably be the ticket in your case.. Do you have the programmer's guide for GoldMine? I think you're going to need it. You used to be able to get it from their site, but they stopped supplying it, I think.. I used to have an FTP with it on there, but, alas, I'm having router problems right now and that FTP is down... You might also take a look at te various tools written by a buddy of mine over at as he knows his way around GoldMine and has numerous free and commercial utilities.. you might find one that does what your user is looking for already --thereby saving you lots of time and headache...




Doug Castell
Computer Control Corp
(310)396-6811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top