Query Help

  • Thread starter Thread starter geebee
  • Start date Start date
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
 
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
 
Back
Top