Hi, I have been struggling with coming up with a way to allow controlling combo box content on the "add" & "edit" pages depending on a couple of different options.
My project has three tables, items (main table), users and districts. I have within the users table two fields that control my desired combo box on the add page for items. These two fields within users are "admin" and "district-id", where admin and district-id are int(11) type. I want to control the combo box by checking the current logged-in user and if the users "admin" field is a 1, or 3 I want to list all users except for those with "admin" 1 or 3. Otherwise I only wish to list the users that have the same district-id values. I am creating $_SESSION[admin] and $_SESSION[district-id] variables when the user logs-in.
Or another way is:
admin district-id list users by
1 or 3 any > 1 all users except those with admin in (1,3)
others any only those users that match by district-id's
I have tried coming up with MySQL $strWhereClause in edit page -before SQL (there is not one for add page?). I have also tried creating customQuerry events...I have also tried using the lookup table "where" option, but I can only do one or the other method this way, not both.
I am now quite stuck with this one. If you have any ideas I can try, or another better method of doing this, let me know. My project is still in the design phase, so changes can be made easily.
Thanks,
Rod