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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EVAL Function is putting out an odd result. 2

Status
Not open for further replies.

Johnnycat1

Programmer
May 4, 2005
71
US
I have a form wherein I use the following language:

Forms!FrmProjectPricing!FrmProjectPricingFixturesSubform.Form![Unit Cost]
= Eval("IIf([Forms]![FrmProjectPricing]![FrmProjectPricingFixturesSubform]![PPFixtureLotPriceName] Is not Null,[Forms]![FrmProjectPricing]![FrmProjectPricingFixturesSubform]![PPFixtureUnitCost]=0")

The strange thing is that it is putting out a boolean 0 or 1 in the [Unit Cost] rather than evaluating the iif statement and simply changing the [Unit Cost] to 0 when the iif statement is true.

Any ideas what I am missing here? As always, your help is greatly appreciated.
 
Why using the Eval function instead of IsNull ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya Johnnycat1 . . .
Agree with PHV. No need for EVal here.

A starting point:
Code:
[blue]   frm As Form
   
   Set frm = Forms!FrmProjectPricing!FrmProjectPricingFixturesSubform.Form
   If Not IsNull(frm!PPFixtureLotPriceName) Then frm![Unit Cost] = 0
   Set frm = Nothing[/blue]

BTW . . . [blue][Forms]![FrmProjectPricing]![FrmProjectPricingFixturesSubform]![PPFixtureUnitCost]=0[/blue] is a comparison inside the IIF and returns True/False (-1/0).

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Aceman & PHV as always your posts are most helpful!

I'm good Aceman. I am glad to see you are still out there helping us VB challenged people. Again, I really appreciate the help.

My database is so much better because of the help I get at Tek-Tips.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top