accessguy52
Programmer
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
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