This topic is locked

Record selection (Sub BeforeQueryList(strSQL,strWhereClause,strOrderBy

10/19/2008 5:26:28 AM
ASPRunnerPro General questions
P
Pistelli2001 author

Hi!
I used to List Page (Sub BeforeQueryList (strSQL, strWhereClause, strOrderBy) and BeforeShowSearch (smarty, templatefile) a table proposal
This code
fil = SESSION ( "FilID")

are SESSION = ( "AreaID")

liv = (SESSION ( "groupId"))
If liv = 1 then

gsqlWhere = "id_filiale =" & fil

end if

if liv then = 2

gsqlWhere = "id_area =" & are

end if
and everything works properly, appear only records that meet this condition
I have the same inserted in report

Sub BeforeQueryReport (strSQL, strWhereClause, strOrderBy)

but does not work and gives me the following error
Error Type:

Microsoft JET Database Engine (0x80004005)

The reference to the specified 'id_filiale' could be on more tables listed in the commencement of FROM SQL.

/ Conditions / Stampa_Proposta_report.asp, line 562
Surely fields if_filiale and id area are not unique in the report because there are more 'tables with the same field?
Help me!
Thank

P
Pistelli2001 author 10/19/2008

Thanks to all , I have resolved this way
fil= SESSION("FilID")

are= SESSION("AreaID")

liv = (SESSION("GroupID"))
If liv = 1 then

gsqlWhere="[_proposta].id_filiale= " & fil

end if

if liv = 2 then

gsqlWhere="[_proposta].Id_Area=" & are

end if