# MS Access 2010 form question

**URL:** <https://boards.straightdope.com/t/ms-access-2010-form-question/680999>\
**Category:** Factual Questions\
**Created:** [February 10, 2014, 7:42pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999 "2014-02-10T19:42:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/skammer/32/143_2.png) [@Skammer](https://boards.straightdope.com/u/Skammer)\
**Post date:** [February 10, 2014, 7:42pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999/1 "2014-02-10T19:42:30Z")

</div>

I’m a relative newbie at creating Access forms and I could not find an answer to his on the Access forums I usually reference. Here’s my question:

I’ve created a form that adds records to a table “DATA.” I want the user to select from a combo box the value “Y”, “N”, or “N/A.”

If the user selects “Y” I want the DATA record to have a 1; for “N” a zero, and for “N/A” a null value.

So I have another table, VALUES, that looks like this:

```auto

1 Y 1
2 N 0
3 N/A  

```

In the combo box properties, I have Row Source = VALUES, Row Source Type = Table/Query and Bound Column = 3. For the formatting I have Column Count = 3 and Column Widths = 0;3;0.

This works fine for “Y” and “N” values - it populates my DATA table with the value of 1 or 0. And in fact if I select “N/A” it populates DATA with a null value. But…

The problem is in my form, if I select “N/A”, it disappears. It’s as if because the value of the field in DATA is now null, it’s not displaying a value in the combo box. I want it to show the “N/A” that the user selected.

Is there another way I should be doing it?

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [February 10, 2014, 8:36pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999/2 "2014-02-10T20:36:50Z")

</div>

Try a value of @N/A instead?

---

<div class="post-metadata">

**Author:** ![Skammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/skammer/32/143_2.png) [@Skammer](https://boards.straightdope.com/u/Skammer)\
**Post date:** [February 10, 2014, 8:45pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999/3 "2014-02-10T20:45:13Z")

</div>

If I change the value of “N/A” to 3 (in the third column), or any other value except null, it works. The form shows “N/A” and the controls source “DATA” gets that value assigned to that field for the current record. So it’s a problem with using null but I’m not sure what the way around it is if I don’t want that field to have a value.

---

<div class="post-metadata">

**Author:** ![TroutMan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troutman/32/6721_2.png) [@TroutMan](https://boards.straightdope.com/u/TroutMan)\
**Post date:** [February 10, 2014, 9:00pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999/4 "2014-02-10T21:00:22Z")

</div>

I don’t think there’s an easy way around it. The equation NULL = NULL does not evaluate to true in Access, so it can’t match the value from the table to any values in your combo box.

Maybe you could accomplish it with some back-end code. How complex do you want to make this?

---

<div class="post-metadata">

**Author:** ![Skammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/skammer/32/143_2.png) [@Skammer](https://boards.straightdope.com/u/Skammer)\
**Post date:** [February 10, 2014, 9:04pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999/5 "2014-02-10T21:04:47Z")

</div>

Yeah, that seems to be the problem. There’s probably an easier workaround than spending time on trying to code something. Instead of NULL I’ll try using an arbitrary value and then ignoring that value later when I create my reports.

---

<div class="post-metadata">

**Author:** ![TroutMan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troutman/32/6721_2.png) [@TroutMan](https://boards.straightdope.com/u/TroutMan)\
**Post date:** [February 10, 2014, 9:15pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999/6 "2014-02-10T21:15:39Z")

</div>

Actually, here’s an easy way: as you suggested, use an arbitrary value for N/A (say “@NA”). Then add another field to your table with datatype Calculated and the formula below:

```auto

IIf([MyValue]="@NA", Null, [MyValue])

```

It’s essentially what you said, but you can use the calculated field in your reports instead of worrying about ignoring a specific value.

---

<div class="post-metadata">

**Author:** ![Skammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/skammer/32/143_2.png) [@Skammer](https://boards.straightdope.com/u/Skammer)\
**Post date:** [February 10, 2014, 9:39pm UTC](https://boards.straightdope.com/t/ms-access-2010-form-question/680999/7 "2014-02-10T21:39:22Z")

</div>

Hey, I think that will work, because I already have to have a calculated field with the resulting field value anyway. I should be able to stick your IIF statement into my formula. Thanks for the idea!
