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

Dynamicaly populated multiply list box

Status
Not open for further replies.

lisalisalisa

Programmer
Joined
Sep 16, 2001
Messages
1
Location
CA
How to populate multiply list box dynamicaly?
<CFQUERY NAME = &quot;TableRelInfo&quot; DATASOURCE = &quot;#DataSourceName#&quot;>
SELECT TableID AS RelatedTableID, TableName
FROM Tables
WHERE TableTypeID = 2
ORDER BY TableName
</cfQuery>

//Result

2 Communications
7 Contact
4 ContactAddress
23 InvoiceDetails
14 OrderDetails
9 Orders
11 Organization
19 PlacementOrder


<CFQUERY name = &quot;MainQuery&quot; DATASOURCE = &quot;#DataSourceName#&quot;>
SELECT RelatedTableID
FROM Tables, TableContent, TableType
WHERE TableContent.TableID = Tables.TableID
AND TableType.TableTypeID = Tables.TableTypeID
AND Tables.TableID = #URL.TableID#
</cfQuery>

//Result

23,19
7,14



<cfSELECT NAME = &quot;RelatedTableID&quot; MULTIPLE = &quot;Yes&quot; SIZE = &quot;10&quot;>
<OPTION>
<cfOUTPUT QUERY = &quot;TableRelInfo&quot;>
<cfIF ActionName IS &quot;Update&quot;>
<OPTION VALUE = &quot;#RelatedTableID#&quot;
<cfIF #ListContains ( TableRelInfo.RelatedTableID,
MainQuery.RelatedTableID,1, )
#IS NOT 0>
#IIf ( TableRelInfo.RelatedTableID IS
MainQuery.RelatedTableID,
DE ( 'Selected' ), DE ( '' ) )#
</cfIF>>#TableName#
<cfELSEIF ActionName IS &quot;Insert&quot;>
<OPTION VALUE = &quot;#RelatedTableID#&quot;
#IIf ( TableRelInfo.RelatedTableID IS RelatedTableID,
DE ( '' ), DE ( 'Selected' ) )#>#TableName#
</cfIF>
</cfOUTPUT>
</OPTION>
</cfSELECT>

Any help will be appriciate
Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top