Hi, at the minute when i add a user to the database they can view all companies on a list box. Im trying to reduce this so they will only have access to what i enter in a table called USERSvCOMPANYACCESS, which has the Users Key and the Company Number in it. Im using the below code, but its displaying all company numbers I enter to that table, rather than just the numbers I have chosen for that one user.
Can anyone help me out here? <cfquery name="qgetcompany" datasource="#request.dsn#"> select COMPANY_Number,USERS_Key from USERSvCOMPANYACCESS ORDER BY COMPANY_Number </cfquery> <cfloop query="qgetcompany"> <option value="#COMPANY_Number#" <cfif isDefined('FORM.COMPANY_Number') AND (FORM.COMPANY_Number EQ COMPANY_Number)>selected</cfif>> [#COMPANY_Number#] </option> </cfloop> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:326771 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4