IIF?

  • Thread starter Thread starter kaiiak
  • Start date Start date
K

kaiiak

I'm trying to develop a form that will do the following:

If the value of Field1 is A, then Field2 is also A. But,
if Field1 is not A, then Field2 requires user to input.

Is it possible to do this? (I think that IIF is the wrong
expression here. At least, I can't get it to work.)

A little help, please. Thanks.
 
I'm trying to develop a form that will do the following:

If the value of Field1 is A, then Field2 is also A. But,
if Field1 is not A, then Field2 requires user to input.

Is it possible to do this? (I think that IIF is the wrong
expression here. At least, I can't get it to work.)

A little help, please. Thanks.

You can do this in a form, however the value is not to be saved in any
table. It is just going to be displayed on the form.
As control source in an Unbound control:

=IIf([Field1] = "A",[Field1],InputBox("Enter a value"))

Perhaps if you explained why you want to duplicate the value if it is
"A", we might be able to offer a different solution.
 
Thanks.

Oh, actually, I think I may have misstated what I want it
to do (although, I think your solution will work--I'll
give it a shot.)

Basically, what I want is to help make data entry easier.
If my Customer is a Buyer, I want the Customer's
information to be copied to the Buyer fields. If the
Customer is a Seller, I want the Customer's information
to be copied to the Seller fields.

So far, what I've done is set up the Customer fields to
accept input. Then, there's a drop-down menu so the user
can say whether the Customer is a Buyer or Seller. If the
user chooses Buyer, then the Customer data is copied to
the Buyer fields.

The problem I run into, however, is if the user chooses
Seller. The Buyer fields are then locked (because they
have have no set "falsepart")--even though the Buyer
fields still require input.

Anyhow, will give your suggestion a try. Thanks again!

-----Original Message-----
I'm trying to develop a form that will do the following:

If the value of Field1 is A, then Field2 is also A. But,
if Field1 is not A, then Field2 requires user to input.

Is it possible to do this? (I think that IIF is the wrong
expression here. At least, I can't get it to work.)

A little help, please. Thanks.

You can do this in a form, however the value is not to be saved in any
table. It is just going to be displayed on the form.
As control source in an Unbound control:

=IIf([Field1] = "A",[Field1],InputBox("Enter a value"))

Perhaps if you explained why you want to duplicate the value if it is
"A", we might be able to offer a different solution.


--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Back
Top