Expression Help

tubar

Registered User.
Local time
Today, 09:40
Joined
Jul 13, 2006
Messages
190
LETS SAY I HAVE THREE PART NUMBERS FOR DIFFERENT MANUFACTORS. IF THE USER SELECTS GE MANUFACTOR THEN THE GE PART NUMBER SHOULD BE LISTED IN PART NUMBER. I GET ERRORS WITH THIS EXPRESSION IN MY QUERRY

Expr1: IIf([MANUFACTOR SENT]="GENERAL ELECTRIC",[PART NUMBER]=[GE PART #])


HELP
 
in your query, you asre actually trying to set a value for expr1:

your test is saying that if manf is GE, then do something, else do something else

firstly you have no something else.

secondly what you are actually doing is performing a boolean equality test on two fields [part number] and [ge part # 1], so i suppose you are getting either true or false as an answer. (or 1 or 0 - something like that)

your query perhaps should be

IIf([MANUFACTOR SENT]="GENERAL ELECTRIC",[GE PART #],"some other ref")

but what this will actually do is generate a text or numeric expression FOR expr1, and NOT set a different field [part number] to equal anything. To do that you need an update query.
 
Last edited:
i get error with this expression. and the new expression you gave me
-----IIf([MANUFACTOR SENT]="GENERAL ELECTRIC",[GE PART #],"some other ref")----now just puts "some other ref" in expr1...

can some one help me...and not give me advice they know wont work.
 
i have a table which list bulb info...like three manufactors part numbers...

i created a querry for when i order a bulb (with information from a order table)
if i select "ge" for the manufactor i want the ge part number to go in the part number feild in this querry.

my expression
Expr1: IIf([MANUFACTOR SENT]="2",[GE PART #])
doesnt work
 
the "some other ref" was meant to be an indicator that you set it to whatever you wanted for a false condition, not the text for you to use.

I said in my original reply that you can't use select queries to update columns in the way you were trying to do. You need an update query
 

Users who are viewing this thread

Back
Top Bottom