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
 

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

Wifi Network Issue 0
Excel Excel macro and passwords 3
error 2489 1
Click on website button with tag "button" 0
Testing for Password on a Form 1
Popup form 3
Dlookup only returning the first record 6
Combo Box Columns 11

Back
Top