Wow - that's a slick solution! There's only one concern that I have. At some point in the future, I'll probably want to add other criteria. For example, if this were a database for Christmas trees, the code you sent me would allow me to check the checkbox, then use the combo box to select...
Many thanks for taking the time to work with me on this. I'm just thankful it's part of a forum discussion - hopefully it will save some other users some time and energy!
Right - this is a query. The query goes and looks at a checkbox and a combo box. If the box is checked, the query will use...
Sorry, let me reframe:
Here's what you sent me:
IIf([Forms]![form-name]![checkbox-name]=True, [FieldName]=[Forms]![form-name]![combobox-name], True)
If the form "form-name" is now going to be the subform to a form called "big-form", then here's what I did...
I think I actually get it! But there's a little twist... The form I built this on was supposed to become a subform for the Switchboard form. When I made it a subform, it started asking me to define all the criteria through pop-up boxes, which was understandable. So I went into the code you sent...
Ok - I get the "do whatever is true, do whatever is false." And if it was an expression like SomeVariable=15, then I could get that. If it's something like IIF(GreenVariable>15, RedVariable=5, RedVariable=2). That makes sense.
What I'm having a hard time wrapping my brain around is having the...
Ahhhh... ok... gotcha.
But I'm still a little confused on the logic. The IIf function has two outomes - what to do if the condition is true, and what to do if the condition is false. What does the value-if-false of "True" do? How does the function evaluate the criteria of "True"?
-- Mark
Wow - Great! I had seen the earlier post, but missed the significance of giving it its own column in the query. Since this is such a basic need in Access (at least I think so anyway...) I'd like to wrestle with this a moment to explain why this works. Please comment, and maybe nobody else needs...
Greetings,
I've been banging my head on this for days, and what really makes this difficult is the number of websites which say it should work just fine!
I'm working with Access 2003 and trying to make use of the IIf function. I have given my fields generic names in the examples below.
I have...