Multiple instances of the same field

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

Guest

Hopefully I can explain this properly. I have a field in a table called
"Nutrition". Another field in the table is called "Order". Is it possible
to write a formula similar to this one and get the result I want. This
particular formula doesn't work properly.

=IIF([Order]=1,[Nutrition],"")

In the formula, the number "1" may be any number between 1 and 22.
Depending on the number, I want the [Nutrition] value to match the order
number. This formula only gives me the first instance of Nutrition in the
database. Can this be done? Thanks in advance.
 
Do you mean you want to show all the values of nutrition where order = 1? If
so, you don't need a formula you need a query that says "SELECT nutrition
FROM tablename WHERE order = 1".

If this doesn't help please try explaining the problem again.

Regards
 
No. It's more asthetics than anything. I'm trying to duplicate a nutrition
label. I need to be able to place the results from the nutrition field in
different areas of my report. I have 22 different nutritional components for
each item. I have 5,000 items. I wanted to create 22 text boxes and let
each one of them show a different component. I want to use the data in the
nutrition field to populate the 22 different text boxes. I'm sure I've been
as clear as mud, but that's what I want to do.

The only other option I have (that I know how to do) is create a new table
with 22 fields from a crosstab query from my original table with only the
nutrition field.
--
Don Rountree


Gareth said:
Do you mean you want to show all the values of nutrition where order = 1? If
so, you don't need a formula you need a query that says "SELECT nutrition
FROM tablename WHERE order = 1".

If this doesn't help please try explaining the problem again.

Regards

Don said:
Hopefully I can explain this properly. I have a field in a table called
"Nutrition". Another field in the table is called "Order". Is it possible
to write a formula similar to this one and get the result I want. This
particular formula doesn't work properly.

=IIF([Order]=1,[Nutrition],"")

In the formula, the number "1" may be any number between 1 and 22.
Depending on the number, I want the [Nutrition] value to match the order
number. This formula only gives me the first instance of Nutrition in the
database. Can this be done? Thanks in advance.
 
Sorry, I'm still having trouible understanding this. Is it that, for 1
record, you have 1 nutrition field, which can have one of 22 values.
Depending on what the value is you want to display it in a different text box?

OR is it that you have up to 22 nutrition records per item, which you want
to display on 1 report screen in 22 different boxes?

Regards

Don said:
No. It's more asthetics than anything. I'm trying to duplicate a nutrition
label. I need to be able to place the results from the nutrition field in
different areas of my report. I have 22 different nutritional components for
each item. I have 5,000 items. I wanted to create 22 text boxes and let
each one of them show a different component. I want to use the data in the
nutrition field to populate the 22 different text boxes. I'm sure I've been
as clear as mud, but that's what I want to do.

The only other option I have (that I know how to do) is create a new table
with 22 fields from a crosstab query from my original table with only the
nutrition field.
--
Don Rountree


Gareth said:
Do you mean you want to show all the values of nutrition where order = 1? If
so, you don't need a formula you need a query that says "SELECT nutrition
FROM tablename WHERE order = 1".

If this doesn't help please try explaining the problem again.

Regards

Don said:
Hopefully I can explain this properly. I have a field in a table called
"Nutrition". Another field in the table is called "Order". Is it possible
to write a formula similar to this one and get the result I want. This
particular formula doesn't work properly.

=IIF([Order]=1,[Nutrition],"")

In the formula, the number "1" may be any number between 1 and 22.
Depending on the number, I want the [Nutrition] value to match the order
number. This formula only gives me the first instance of Nutrition in the
database. Can this be done? Thanks in advance.
 

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