iif

K

kevcar40

i am trying to write a formula that checks for the day of the week
([yellow pages hours 31days].Form!text82="Sat"
i then want to check the score from the night shift
[yellow pages night Scores 31days].Form![5]=0

if the result is Sat and score =0 i want to add days hours(text217] to [text697]

if the result is Sat and score <> 0 i want to add days hours(text217] to [text514]

if the result is <> Sat and score 0 i want to add days hours(text217] to [text514]

formula i trying
IIf([yellow pages hours 31days].Form!text82="Sat" And [yellow pages night Scores 31days].Form![5]=0,([Text217]+[Text697]),([Text514]+[Text217]))
 
A

Access Developer

I suspect you need to provide more detail about where you are executing this
code or using this formula, its context, and what, exactly you are expecting
as a result. I ask because, for example, the first line of code appears to
be addressing a Control named "text82" in the Form object of a Subform
Control named [yellow pages hours 31 days]. If that code is executed from
an event in the parent form that contains the Subform Control, it would be
more usual for it to read:

Me![yellow pages hours 31days].Form!text82

or if executing it in a standard module, a reference to the parent form in
the Forms collection instead of the Me 'shorthand'.

Larry Linson
Microsoft Office Access MVP

P. S. Just a tip: unless your memory is better than most of us have, you
will likely make your work easier if you will rename the Controls from their
default "textXX" names to something more meaningful. Many experienced
Access developers use a naming convention created by Greg Reddick and
documented at his site, http://www.xoc.net/standards/.
 

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

Top