Need Help with IIF Statement

G

Guest

I have used the query build of the Row Source of a form to have only the
current user information displayed when they open the Form. I would like to
add a IIf stament that will display all the records if the supervisor or
manger opens the Form, this is possible if how I hope someone will give me
some help on write the statement. Here is the SQl from the query.
SELECT tblx_contact.fullname AS Name, [x_Daily Research Comp].* AS
Employee1, [x_Daily Research Comp].Employee AS 1
FROM tblx_contact INNER JOIN [x_Daily Research Comp] ON
tblx_contact.strEmpName = [x_Daily Research Comp].Employee
WHERE ((([x_Daily Research Comp].Employee)=Environ("UserName")));

Thanks in advance
 
G

Guest

Try this:

SELECT tblx_contact.fullname AS Name, [x_Daily Research Comp].* AS
Employee1, [x_Daily Research Comp].Employee AS 1
FROM tblx_contact INNER JOIN [x_Daily Research Comp] ON
tblx_contact.strEmpName = [x_Daily Research Comp].Employee
WHERE [x_Daily Research Comp].Employee LIKE
IIF(Environ("UserName")="Admin","*",Environ("UserName"))

- Raoul
 
G

Guest

Raoul.. Thanks!!

JaRa said:
Try this:

SELECT tblx_contact.fullname AS Name, [x_Daily Research Comp].* AS
Employee1, [x_Daily Research Comp].Employee AS 1
FROM tblx_contact INNER JOIN [x_Daily Research Comp] ON
tblx_contact.strEmpName = [x_Daily Research Comp].Employee
WHERE [x_Daily Research Comp].Employee LIKE
IIF(Environ("UserName")="Admin","*",Environ("UserName"))

- Raoul


Raj said:
I have used the query build of the Row Source of a form to have only the
current user information displayed when they open the Form. I would like to
add a IIf stament that will display all the records if the supervisor or
manger opens the Form, this is possible if how I hope someone will give me
some help on write the statement. Here is the SQl from the query.
SELECT tblx_contact.fullname AS Name, [x_Daily Research Comp].* AS
Employee1, [x_Daily Research Comp].Employee AS 1
FROM tblx_contact INNER JOIN [x_Daily Research Comp] ON
tblx_contact.strEmpName = [x_Daily Research Comp].Employee
WHERE ((([x_Daily Research Comp].Employee)=Environ("UserName")));

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top