can it be done

samonwalkabout

Registered User.
Local time
Today, 17:30
Joined
Mar 14, 2003
Messages
185
simplified i have a table of 5 memo fields called named comment1-comment5 the table also contains a txt feild which says how many comment boxes are completed.(number comp)

i want a qry that will report the most recent comment only ie if number comp = 4 then only show comment 4 in a report.

Any ideas?

Thanks
 
Assuming Number Comp is a numeric field, try this expression in a Field: cell in the query grid:-

Comment: IIf([Number Comp]=1,[Comment1],IIf([Number Comp]=2,[Comment2],IIf([Number Comp]=3,[Comment3],IIf([Number Comp]=4,[Comment4],[Comment5]))))


However, if Number Comp is a text field, put the numbers in double quotes e.g.

Comment: IIf([Number Comp]="1",[Comment1],... etc.
 
too complex

Thanks for the help i didnt know you could drop expressions into a qry like that!! It works well but i actually have 20 comment boxes and if code for 20 the expression is too long. How can i get around this??
 

Users who are viewing this thread

Back
Top Bottom