IFF in Criteria

G

Guest

I have a text field from a form that contains a one letter code.

Iff the Letter is a "Z" then I want to display all the records, if it is
another letter than just the records that meet that criteria. Types are A, H,
M and T

Cannot figure out the syntax it wants? This is what I have so far.

IFF(Forms![frmStudents]![TextS],= "Z", "A" or "H" or "M" ot
"T","Forms!frmStudents!TextS"

Thanks for reading my question and any help.

Len
 
K

Ken Snell [MVP]

SELECT * FROM TableName
WHERE TypeFieldName Like
IFf(Forms![frmStudents]![TextS]= "Z", "*",
Forms!frmStudents!TextS);
 
D

Douglas J. Steele

That's IIf, not IFf.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ken Snell said:
SELECT * FROM TableName
WHERE TypeFieldName Like
IFf(Forms![frmStudents]![TextS]= "Z", "*",
Forms!frmStudents!TextS);
--

Ken Snell
<MS ACCESS MVP>


Len said:
I have a text field from a form that contains a one letter code.

Iff the Letter is a "Z" then I want to display all the records, if it is
another letter than just the records that meet that criteria. Types are
A, H,
M and T

Cannot figure out the syntax it wants? This is what I have so far.

IFF(Forms![frmStudents]![TextS],= "Z", "A" or "H" or "M" ot
"T","Forms!frmStudents!TextS"

Thanks for reading my question and any help.

Len
 
K

Ken Snell [MVP]

Ya know, when I looked at that, (while talking on the phone), I knew
something didn't look right..... <g >

--

Ken Snell
<MS ACCESS MVP>

Douglas J. Steele said:
That's IIf, not IFf.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ken Snell said:
SELECT * FROM TableName
WHERE TypeFieldName Like
IFf(Forms![frmStudents]![TextS]= "Z", "*",
Forms!frmStudents!TextS);
--

Ken Snell
<MS ACCESS MVP>


Len said:
I have a text field from a form that contains a one letter code.

Iff the Letter is a "Z" then I want to display all the records, if it is
another letter than just the records that meet that criteria. Types are
A, H,
M and T

Cannot figure out the syntax it wants? This is what I have so far.

IFF(Forms![frmStudents]![TextS],= "Z", "A" or "H" or "M" ot
"T","Forms!frmStudents!TextS"

Thanks for reading my question and any help.

Len
 
G

Guest

IIf([Forms]![TestForm]![TextA]="Z","*",[Forms]![TestForm]![TextA])

After a typeo problem the above code still does not work.
It finds a specific Type OK, But will not show all the types when the letter
Z is entered.
 
G

Guest

IIf([Forms]![TestForm]![TextA]="Z","*",[Forms]![TestForm]![TextA])
The * does not work, it does not select all the types? However when the
letters A to Y are entered (Any one of them) it works.



Ken Snell said:
Ya know, when I looked at that, (while talking on the phone), I knew
something didn't look right..... <g >

--

Ken Snell
<MS ACCESS MVP>

Douglas J. Steele said:
That's IIf, not IFf.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ken Snell said:
SELECT * FROM TableName
WHERE TypeFieldName Like
IFf(Forms![frmStudents]![TextS]= "Z", "*",
Forms!frmStudents!TextS);
--

Ken Snell
<MS ACCESS MVP>


I have a text field from a form that contains a one letter code.

Iff the Letter is a "Z" then I want to display all the records, if it is
another letter than just the records that meet that criteria. Types are
A, H,
M and T

Cannot figure out the syntax it wants? This is what I have so far.

IFF(Forms![frmStudents]![TextS],= "Z", "A" or "H" or "M" ot
"T","Forms!frmStudents!TextS"

Thanks for reading my question and any help.

Len
 
K

Ken Snell [MVP]

Post the actual SQL statement of your query with this IIf statement in it.

--

Ken Snell
<MS ACCESS MVP>

Len said:
IIf([Forms]![TestForm]![TextA]="Z","*",[Forms]![TestForm]![TextA])

After a typeo problem the above code still does not work.
It finds a specific Type OK, But will not show all the types when the
letter
Z is entered.


Len said:
I have a text field from a form that contains a one letter code.

Iff the Letter is a "Z" then I want to display all the records, if it is
another letter than just the records that meet that criteria. Types are
A, H,
M and T

Cannot figure out the syntax it wants? This is what I have so far.

IFF(Forms![frmStudents]![TextS],= "Z", "A" or "H" or "M" ot
"T","Forms!frmStudents!TextS"

Thanks for reading my question and any help.

Len
 

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