IIf Staement in control source of form

  • Thread starter IIF from form to table
  • Start date
I

IIF from form to table

I have a form based on a table. I put the following: =IIf([Age Group]
="17-21","42",IIf([Age Group] ="22-26","40",IIf([Age Group]
="27-31","38",IIf([Age Group] ="32-36","36",IIf([Age Group]
="37-41","34",IIf([Age Group] ="42-46","30",IIf([Age Group]
="47-51","25",IIf([Age Group] ="52-56","20",IIf([Age Group]
="57-61","18",IIf([Age Group] ="62+","16",)))))))))). The dat is changing in
my form but the data is not transfering into my table. How do I fix this
problem?
 
R

Rick Brandt

I have a form based on a table. I put the following: =IIf([Age Group]
="17-21","42",IIf([Age Group] ="22-26","40",IIf([Age Group]
="27-31","38",IIf([Age Group] ="32-36","36",IIf([Age Group]
="37-41","34",IIf([Age Group] ="42-46","30",IIf([Age Group]
="47-51","25",IIf([Age Group] ="52-56","20",IIf([Age Group]
="57-61","18",IIf([Age Group] ="62+","16",)))))))))). The dat is
changing in my form but the data is not transfering into my table. How
do I fix this problem?

Expressions don't get stored, nor do they need to, nor should they be.

To understand further look at the ControlSource property for each control
on your form that DOES store its value in the table. What do you see
there? You see the name of a field (nothing else).

That is a requirement for that behavior. Now look at the ControlSource
property entry you typed above. It's not a field name. Therefore there
is no place for the table to put that value.

The rule is if you can calculate it, you don't need to store it.
 

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