Logic statement for sort on Access 2K Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am sorting information in a report that is based on [TestType]. I would
like to create a logic statement that associates that test type with a
particular string.

For example,

If [TestType]="CP", "Test Method Number for CP",
else,
[TestType]="PW", "Test Method Number for PW",
else,
[TestType]="FG", "Test Method Number for FG"
else if, ""
end

I'm certain my syntax is incorrenct, because I'm getting no results. I
could really use some help on this one? Thanks in advance for any help.
 
Why don't you just use a text box with a control source like:
="Test Method Number for " & [TestType]

Make sure the name of the text box is not "TestType".
 
Thanks for both of your responses. I am using a text box in my attempt to
accomplish this. I've tried writing a nested IIf statement that looks at the
[TestType] field, but it didn't work. There are about 20 different test
types that are pulled into the query, each one of them having their own test
method. The test method, however, is not stored in DB, hence the need for
the somewhat dynamic text box. "Test Method Number", in my example, is a
variable that could represent 20 different strings. Any advice?
--
Somecallmejosh


Duane Hookom said:
Why don't you just use a text box with a control source like:
="Test Method Number for " & [TestType]

Make sure the name of the text box is not "TestType".
--
Duane Hookom
MS Access MVP

Joshua K Briley said:
I am sorting information in a report that is based on [TestType]. I would
like to create a logic statement that associates that test type with a
particular string.

For example,

If [TestType]="CP", "Test Method Number for CP",
else,
[TestType]="PW", "Test Method Number for PW",
else,
[TestType]="FG", "Test Method Number for FG"
else if, ""
end

I'm certain my syntax is incorrenct, because I'm getting no results. I
could really use some help on this one? Thanks in advance for any help.
 
Create a lookup table of TestType and TestMethod. Add this table to your
report's record source.

You should not be creating complex expressions for this type of need.
Maintain your application in tables, not code or expressions in queries.

--
Duane Hookom
MS Access MVP

Joshua K Briley said:
Thanks for both of your responses. I am using a text box in my attempt to
accomplish this. I've tried writing a nested IIf statement that looks at
the
[TestType] field, but it didn't work. There are about 20 different test
types that are pulled into the query, each one of them having their own
test
method. The test method, however, is not stored in DB, hence the need for
the somewhat dynamic text box. "Test Method Number", in my example, is a
variable that could represent 20 different strings. Any advice?
--
Somecallmejosh


Duane Hookom said:
Why don't you just use a text box with a control source like:
="Test Method Number for " & [TestType]

Make sure the name of the text box is not "TestType".
--
Duane Hookom
MS Access MVP

message
I am sorting information in a report that is based on [TestType]. I
would
like to create a logic statement that associates that test type with a
particular string.

For example,

If [TestType]="CP", "Test Method Number for CP",
else,
[TestType]="PW", "Test Method Number for PW",
else,
[TestType]="FG", "Test Method Number for FG"
else if, ""
end

I'm certain my syntax is incorrenct, because I'm getting no results. I
could really use some help on this one? Thanks in advance for any
help.
 

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

Back
Top