![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Access 2003. *Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. *Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH |
#3
| |||
| |||
|
|
On Dec 28, 2:14*pm, donh <donhar... (AT) gmail (DOT) com> wrote: Access 2003. *Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. *Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH Although Ive done an initial search for an answer to my question, searching some more shows Ive got to give more detail. I have a hidden form which records who has looged into database. This form stays open but hidden so I can use it to set criteria (if log in = Maintenance display all records for maintenance). Thats fine until I get to Admin which wants to see everyones records. I have been trying to use an IIF statement to check who logged in and again thats fine for maintenance but have failed miserably in trying to return the FALSE which I would like in this case to be return all records (any jobs that are assigned to Maintenance, Admin, Manager, Retail or named users). Hopefully thats clearer. Any help would be appreciated DonH |
#4
| |||
| |||
|
|
Access 2003. Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH |
#5
| |||
| |||
|
|
If we knew what you have in detail, and something less vague than "multiple criteria", perhaps someone could be of more help. If you have a table of jobs and related "people assignments", with a more-or-less normalized relational database design, it's possible that "regular, ordinary queries" could give the results you desire. -- Larry Linson * Microsoft Office Access MVP * Co-Author, Microsoft Access Small Business Solutions, Wiley 2010 "donh" <donhar... (AT) gmail (DOT) com> wrote in message news:324049a1-a1c7-4e46-9fd4-c84349ac388e (AT) m7g2000vbc (DOT) googlegroups.com... On Dec 28, 2:14 pm, donh <donhar... (AT) gmail (DOT) com> wrote: Access 2003. Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH Although Ive done an initial search for an answer to my question, searching some more shows Ive got to give more detail. I have a hidden form which records who has looged into database. This form stays open but hidden so I can use it to set criteria (if log in = Maintenance display all records for maintenance). *Thats fine until I get to Admin which wants to see everyones records. *I have been trying to use an IIF statement to check who logged in and again thats fine for maintenance but have failed miserably in trying to return the FALSE which I would like in this case to be return all records (any jobs that are assigned to Maintenance, Admin, Manager, Retail or named users). Hopefully thats clearer. Any help would be appreciated DonH |
#6
| |||
| |||
|
|
On 28/12/2011 14:45:18, donh wrote: On Dec 28, 2:14*pm, donh <donhar... (AT) gmail (DOT) com> wrote: Access 2003. *Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. *Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH Although Ive done an initial search for an answer to my question, searching some more shows Ive got to give more detail. I have a hidden form which records who has looged into database. This form stays open but hidden so I can use it to set criteria (if log in = Maintenance display all records for maintenance). *Thats fine until I get to Admin which wants to see everyones records. *I have been trying to use an IIF statement to check who logged in and again thats fine for maintenance but have failed miserably in trying to return the FALSE which I would like in this case to be return all records (any jobs that are assigned to Maintenance, Admin, Manager, Retail or named users). Hopefully thats clearer. Any help would be appreciated DonH I prefere to use a login form that opens a treeview type Menu. The Menu table is joined to the User table so that the menu only displays Sub Menus, forms & reports that the logged on user is allowed to see. In addition, the formscan be set to read only Phil- Hide quoted text - - Show quoted text - |
#7
| |||
| |||
|
|
On Dec 29, 12:01*am, "Access Developer" <accde... (AT) gmail (DOT) com> wrote: If we knew what you have in detail, and something less vague than "multip le criteria", perhaps someone could be of more help. If you have a table of jobs and related "people assignments", with a more-or-less normalized relational database design, it's possible that "regular, ordinary queries " could give the results you desire. -- Larry Linson * Microsoft Office Access MVP * Co-Author, Microsoft Access Small Business Solutions, Wiley 2010 "donh" <donhar... (AT) gmail (DOT) com> wrote in message news:324049a1-a1c7-4e46-9fd4-c84349ac388e (AT) m7g2000vbc (DOT) googlegroups.com... On Dec 28, 2:14 pm, donh <donhar... (AT) gmail (DOT) com> wrote: Access 2003. Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH Although Ive done an initial search for an answer to my question, searching some more shows Ive got to give more detail. I have a hidden form which records who has looged into database. This form stays open but hidden so I can use it to set criteria (if log in = Maintenance display all records for maintenance). *Thats fine until I get to Admin which wants to see everyones records. *I have been trying to use an IIF statement to check who logged in and again thats fine for maintenance but have failed miserably in trying to return the FALSE which I would like in this case to be return all records (any jobs that are assigned to Maintenance, Admin, Manager, Retail or named users). Hopefully thats clearer. Any help would be appreciated DonH Larry, Thanks for comments but I had hoped I had given more detail in my follow up post and my search of the Internet shows Im not the only person to have come accross this and so far without resolution. Although I wish to expand this to incude other departments I want to create a select query that returns information based on who logged in. At present there are two choices Im concerned with. "Maintenance" that will just return jobs that are assigned to the Maintenance team and Admin which will show all jobs. To achieve this I tried using an IIF statement in the Criteria IIF( Forms![frmUserLoggedIn]![UserLoggedIn] ="Maintenance Team","Maintenance Team","*") The Maintenance Team of course works but I have tried all suggestions I can find for the FALSE outcome to return an unfiltered list. Hope that provides the detail required to gain a solution. Thanks in anticipation. DonH |
#8
| |||
| |||
|
|
If we knew what you have in detail, and something less vague than "multiple criteria", perhaps someone could be of more help. If you have a table of jobs and related "people assignments", with a more-or-less normalized relational database design, it's possible that "regular, ordinary queries" could give the results you desire. -- Larry Linson Microsoft Office Access MVP Co-Author, Microsoft Access Small Business Solutions, Wiley 2010 "donh" <donhar... (AT) gmail (DOT) com> wrote in message news:324049a1-a1c7-4e46-9fd4-c84349ac388e (AT) m7g2000vbc (DOT) googlegroups.com... On Dec 28, 2:14 pm, donh <donhar... (AT) gmail (DOT) com> wrote: Access 2003. Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH Although Ive done an initial search for an answer to my question, searching some more shows Ive got to give more detail. I have a hidden form which records who has looged into database. This form stays open but hidden so I can use it to set criteria (if log in = Maintenance display all records for maintenance). Thats fine until I get to Admin which wants to see everyones records. I have been trying to use an IIF statement to check who logged in and again thats fine for maintenance but have failed miserably in trying to return the FALSE which I would like in this case to be return all records (any jobs that are assigned to Maintenance, Admin, Manager, Retail or named users). Hopefully thats clearer. Any help would be appreciated DonH |
#9
| |||
| |||
|
|
Try this WHERE (<yourcriteriafield> = Forms![frmUserLoggedIn]![UserLoggedIn]) OR (Forms![frmUserLoggedIn]![UserLoggedIn] = "Admin") It should filter by who is logged in, unless they are admin. Then all records will be returned. -- AG Email: npATadhdataDOTcom "donh" <donhar... (AT) gmail (DOT) com> wrote in message news:cd571884-daf4-476a-9b58-4a78e9138798 (AT) d8g2000yqk (DOT) googlegroups.com... On Dec 29, 12:01 am, "Access Developer" <accde... (AT) gmail (DOT) com> wrote: If we knew what you have in detail, and something less vague than "multiple criteria", perhaps someone could be of more help. If you have a table of jobs and related "people assignments", with a more-or-less normalized relational database design, it's possible that "regular, ordinary queries" could give the results you desire. -- Larry Linson Microsoft Office Access MVP Co-Author, Microsoft Access Small Business Solutions, Wiley 2010 "donh" <donhar... (AT) gmail (DOT) com> wrote in message news:324049a1-a1c7-4e46-9fd4-c84349ac388e (AT) m7g2000vbc (DOT) googlegroups.com... On Dec 28, 2:14 pm, donh <donhar... (AT) gmail (DOT) com> wrote: Access 2003. Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. Can I use a reference to a table instead? The real world purpose is to see who a job is assigned to and group the seperate names under an umbrella name "Maintenance" Thanks in advance DonH Although Ive done an initial search for an answer to my question, searching some more shows Ive got to give more detail. I have a hidden form which records who has looged into database. This form stays open but hidden so I can use it to set criteria (if log in = Maintenance display all records for maintenance). Thats fine until I get to Admin which wants to see everyones records. I have been trying to use an IIF statement to check who logged in and again thats fine for maintenance but have failed miserably in trying to return the FALSE which I would like in this case to be return all records (any jobs that are assigned to Maintenance, Admin, Manager, Retail or named users). Hopefully thats clearer. Any help would be appreciated DonH Larry, Thanks for comments but I had hoped I had given more detail in my follow up post and my search of the Internet shows Im not the only person to have come accross this and so far without resolution. Although I wish to expand this to incude other departments I want to create a select query that returns information based on who logged in. At present there are two choices Im concerned with. "Maintenance" that will just return jobs that are assigned to the Maintenance team and Admin which will show all jobs. To achieve this I tried using an IIF statement in the Criteria IIF( Forms![frmUserLoggedIn]![UserLoggedIn] ="Maintenance Team","Maintenance Team","*") The Maintenance Team of course works but I have tried all suggestions I can find for the FALSE outcome to return an unfiltered list. Hope that provides the detail required to gain a solution. Thanks in anticipation. DonH- Hide quoted text - - Show quoted text - |
#10
| |||
| |||
|
|
Access 2003. Hi I need to construct a query that selects multiple criteria to return but do not want to hard wire the criteria into the query. |
![]() |
| Thread Tools | |
| Display Modes | |
| |