Users access to a listbox

2009-09-30 Thread Damo Drumm
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

Re: Users access to a listbox

2009-09-30 Thread Randy Adkins
It is going to list them all based on your code: 1. Your query is returning ALL records 2. your displaying all OPTIONs in the SELECT dropdown but ONLY selecting the ones that was populated in the FORM.COMPANY_NUMBER field. If you only want the SELECT dropdown to return the one in

Re: Users access to a listbox

2009-09-30 Thread Damo Drumm
Ive tried your code, but all its giving me now is a blank list box, with nothing to choose in it It is going to list them all based on your code: 1. Your query is returning ALL records 2. your displaying all OPTIONs in the SELECT dropdown but ONLY selecting the ones that was populated in the

RE: Users access to a listbox

2009-09-30 Thread Chuck
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

Re: Users access to a listbox

2009-09-30 Thread Damo Drumm
That works great Chuck, but is there any way i can change the #myUsersKey# which in my case I just replaced it with 25. if other users log on this will still hold 25, so id need it to change for every user, if that is possible You need to filter your data for the User Key that is accessing the

RE: Users access to a listbox

2009-09-30 Thread Chuck
If your user logs in, then when you do the login authenication you can hold their userid in Session. Then use the Session variable in place of the 25, #Session.YourUserVariable#. ~| Want to reach the ColdFusion community with

Re: Users access to a listbox

2009-09-30 Thread Damo Drumm
I dont quite get that For the user to be able to access this page I add their Windows User Profile to a table and from there they can access all the companies If that makes sence If your user logs in, then when you do the login authenication you can hold their userid in Session. Then use the

RE: Users access to a listbox

2009-09-30 Thread Chuck
We a user comes to the site, how do you know who they are? If you run a query against your database you can store the data in Session and use it in your query to get the companies they have access to. ~| Want to reach the