SmileyFace
Programmer
I need help!! This isn't making sense! I am trying to use an 'If' statement to open a report and it won't work....if I write the same code without the 'If' it works fine....here is what works.....the following code passes an ordernum=soeno to a report called soa.rpt.
ReportName = Request.QueryString("ReportName"
& ".rpt"
if Request.QueryString("Debug"
= "Y" then
Response.Write "ReportName = " & ReportName & "<BR>" & vbcrlf
session("debug"
="Y"
end If
OrderNum = Request.QueryString("soeno"
SelectionFormula = "{soa_header.soeno}= '" & OrderNum & "'"
session("oRpt"
.RecordSelectionFormula = cstr(SelectionFormula)
if Request.QueryString("Debug"
= "Y" then
Response.Write "SelectionFormula = " & SelectionFormula & "<BR>" & vbcrlf
end If
Just to test it with an 'If' statement so I could add an else later for use with another report, I tried the following code....basically just added an if-then statement to the same part...and an else end if it doesn't hit the if statement. Here is what it looks like....
ReportName = Request.QueryString("ReportName"
& ".rpt"
if Request.QueryString("Debug"
= "Y" then
Response.Write "ReportName = " & ReportName & "<BR>" & vbcrlf
session("debug"
="Y"
end If
OrderNum = Request.QueryString("soeno"
If Reportname = "soa.rpt" then
SelectionFormula = "{soa_header.soeno}= '" & OrderNum & "'"
session("oRpt"
.RecordSelectionFormula = cstr(SelectionFormula)
else
response.end
end if
if Request.QueryString("Debug"
= "Y" then
Response.Write "SelectionFormula = " & SelectionFormula & "<BR>" & vbcrlf
end If
Basically the first code above works fine but the minute I add the 'If' statement it just goes to the else part and ends it. PLEASE HELP! I am getting real confused! I am sure its a problem with the if ReportName = "soa.rpt" then statement but cannot figure out what!! THANKS.
ReportName = Request.QueryString("ReportName"
if Request.QueryString("Debug"
Response.Write "ReportName = " & ReportName & "<BR>" & vbcrlf
session("debug"
end If
OrderNum = Request.QueryString("soeno"
SelectionFormula = "{soa_header.soeno}= '" & OrderNum & "'"
session("oRpt"
if Request.QueryString("Debug"
Response.Write "SelectionFormula = " & SelectionFormula & "<BR>" & vbcrlf
end If
Just to test it with an 'If' statement so I could add an else later for use with another report, I tried the following code....basically just added an if-then statement to the same part...and an else end if it doesn't hit the if statement. Here is what it looks like....
ReportName = Request.QueryString("ReportName"
if Request.QueryString("Debug"
Response.Write "ReportName = " & ReportName & "<BR>" & vbcrlf
session("debug"
end If
OrderNum = Request.QueryString("soeno"
If Reportname = "soa.rpt" then
SelectionFormula = "{soa_header.soeno}= '" & OrderNum & "'"
session("oRpt"
else
response.end
end if
if Request.QueryString("Debug"
Response.Write "SelectionFormula = " & SelectionFormula & "<BR>" & vbcrlf
end If
Basically the first code above works fine but the minute I add the 'If' statement it just goes to the else part and ends it. PLEASE HELP! I am getting real confused! I am sure its a problem with the if ReportName = "soa.rpt" then statement but cannot figure out what!! THANKS.