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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box variable and asp page 3

Status
Not open for further replies.

accessguy52

Programmer
Sep 18, 2002
73
US
Hello - I'm sorry if my subject line was not explicit enough, but here's my problem. I'm fairly new to ASP and I need to accomplish the following:

I have a page with a combo box that mimics an Access form where the values in the combo box are criteria for a SQL statement that when a button is pushed, an Excel page comes up listing who fits that value. I've got all the code I need to get working in ASP. My problem is this:

how do I tell ASP to "Select * From the value in the combobox where id equals combobox value and send the recordset to Excel in the browser". I have no problem with that. The combo control is called "Title". I think the compiler is saying, "WHAT control from WHAT page?"

Here's the code:

sSQL = "SELECT DISTINCT TBL_MASTER.Record_ID,[TBL_MASTER].[Last_Name], [First_Name] AS Name,"
sSQL= sSQL & " TBL_HR_Data.Application_Received, TBL_POSITIONS_OPEN.Position_Title,"
sSQL= sSQL & " TBL_POSITIONS_OPEN.POSITION_ID, TBL_HR_SEC_SHARE.Phone#1, TBL_HR_SEC_SHARE.Phone#2,"
sSQL= sSQL & " TBL_HR_SEC_SHARE.Phone#3, TBL_HR_SEC_SHARE.Email, TBL_HR_Data.Notes "
sSQL= sSQL & " FROM TBL_MASTER LEFT JOIN TBL_HR_Data ON TBL_MASTER.Record_ID = TBL_HR_Data.Record_ID INNER JOIN TBL_POSITIONS_OPEN RIGHT JOIN TBL_POSITION_CANDIDATES ON TBL_POSITIONS_OPEN.POSITION_ID = TBL_POSITION_CANDIDATES.POSITION_ID ON TBL_MASTER.Record_ID = TBL_POSITION_CANDIDATES.Record_ID INNER JOIN TBL_HR_SEC_SHARE ON TBL_MASTER.Record_ID = TBL_HR_SEC_SHARE.Record_ID LEFT JOIN TBL_SECURITY_DETAIL ON TBL_MASTER.Record_ID = TBL_SECURITY_DETAIL.Record_ID"
sSQL= sSQL & " Where TBL_POSITIONS_OPEN.POSITION_ID= '" & Request("Title") & "'"

Ignore everything but the last line. It's the request part.
Am I doing that right? It's probably an absurdly simple solution, I just don't know it.

Does this request or does it need more clarification to everyone? Thanks much in advance. Mike
 
He should have given stars when it worked - you guys (onpnt and Tarwn) did a lot to help. So - I'll give you the stars... -----------------------------------------------------------------
[pc] Be nice. It's only doing what you tell it to do.
mikewolf@tst-us.com
 
Thanks for stars (mwolf) Mike :)
Glad it worked for you (accessguy) Mike,

Hmm, Mike and Mike...I'm trying to think of something funny to say, but I can't :p

-Tarwn
11 hours till beginning of vacation time! --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
I had no idea how to put stars or anything in my post - so here's some for you guys [stars]. Thanks again....

Until next post...
accessguy52
 
Heh, by then I'll be back in the horse collar running in circles :)

And for future reference (mwolf already covered it so no need to duplicate his effort) when you wish to add stars, the link is located:
Code:
About 1/2 to 1 inch down under arrow:
  |
  |
  |
 \ /
  V
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
What does "vacation" mean? [flush2][bomb][flush] -----------------------------------------------------------------
[pc] Be nice. It's only doing what you tell it to do.
mikewolf@tst-us.com
 
Vacation:
the whole month before vacation:
zelda_smith.gif

the week before vacation:
banghead.gif

last afternoon working:
ola.gif

The last hour before vacation time:
hourglass.gif

Leaving work to start vacation:
flip.gif

First morning of vacation:
sleepey.gif

First Night of Vacation:
beerchug.gif
beerpassout.gif
beerchug.gif

Next morning of vacation, finally getting home:
offtheair.gif

Next Afternoon of Vacation, waking up:
microwave.gif


First Day Back:
cry.gif

First Monday after day back:
construction.gif

Your coworkers monday afternoon:
makefun.gif


Heh, I have more but by now I've already created a nice little extra load to my server :)

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
FAQ FAQ20-2863
= new Forums.Posting.General.GettingAnswers()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top