You need to filter your data for the User Key that is accessing the code.
You can either put a WHERE clause in your SQL Statement or you can put a
conditional statement around the options looking at the USERS_Key.

Query:

The <cfqueryparam> is made up and you should use your information to set
that up.

<cfquery name="qgetcompany" datasource="#request.dsn#">
        select COMPANY_Number,USERS_Key
        from USERSvCOMPANYACCESS
        WHERE USERS_Key = <cfqueryparam cfsqltype="integer"
value="#myUsersKey#" />
        ORDER BY COMPANY_Number
</cfquery>

Conditional:

<cfloop query="qgetcompany">
<cfif qgetcompany.USERS_key EQ myUsersKey>
        <option value="#COMPANY_Number#" 
        <cfif isDefined('FORM.COMPANY_Number') AND (FORM.COMPANY_Number EQ
COMPANY_Number)>selected</cfif>>
        [#COMPANY_Number#]
        </option>
</cfif>
</cfloop>

HTH
Chuck


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326774
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to