Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Get FieldName as Value

Status
Not open for further replies.

hlubpc09

Technical User
Jan 13, 2009
10
I have two table (created by someone else). One contains the date, order number, customer name, etc. The other table contains the test methods perform and it store values. click on url.

I create a query (to be used as report later) and would like to use the 'Field Name' such as 'Abrasion(fabric)' instead of 1 as value.

Can someone help?

thanks
 
It seems that a look-up field has been used in your table. This is not recommended. The best solution would be to make the field a normal numeric field and to create a a look-up table for the text description, if one does not already exist. You could then build queries for use in forms etc that join the two tables.

 
ok. Then in the 'control source' when create a report, is it possible to write a simple code that says if the values of the field name is not empty (no matter what values it is in it); then write 'abrasion'. if the field name value is empty then don't write anything.

I try this code:

=IIf([abrasion] <> "", "Abrasion")

when i run the query, on the text field; it says "#error"

thanks
 
And this ?
=IIf(Trim([abrasion] & "") <> "", "Abrasion", "")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Still got the same error message. I already check in the database to be sure that I do have data in it and it does. any other ideas?

Thanks
 
well according to your picture the field Abrasion (fabric) is a number....you can't compare a number to an empty string (which is what "" is)....
maybe:
Code:
iif([Abrasion (fabric)] = 1, "Is One", "Not One")

Leslie

Have you met Hardy Heron?
 
ignore the attach url. got it to work. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top