Query Help

G

geebee

Hi,

I have the following as the recordsource for my form:

IIf([Forms]![password]![user name] In
("administrator","gerald"),[names]![user password],
[Forms]![password]![user name])


The goal is to list all the record in the table if the
[forms]![password]![username] is "administrator"
or "gerald" and to list only those records where the user
name is = forms![password]![user name] if the [forms]!
[password]![user name] is not "administrator"
or "gerald".

What am I doing wrong?


Thanks in advance,
geebee
 
T

TC

That is not a valid recordsource. The recordsource property must be the name
of a table, the name of a saved query, or a properly written SELECT
statement. What you have written, is none of those three.

Set the recordsource to the table name, then put the following in the Filter
property, and set the FilterOn property True:

(untested)

[xxx] = [Forms]![password]![user name] OR [Forms]![password]![user name] In
("administrator","gerald")

replacing [xxx] with the name of the user-name field in the table.

HTH,
TC
 

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

Top