If/then-type situation. IF in this field, THEN THIS in that field?

C

creolejazz

Hi. I've got a table with a bunch of fields including Boy/Girl, He/She, and
Him/Her. The Boy/Girl field is included in my form (but the He/She and
Him/Her are not on the form).

I want to set it up so that if I enter "Boy" in the Boy/Girl field on the
form it automatically enters "He" in the He/She field and "Him" in the
Him/Her field in the table. Like wise, a "Girl" entry in the Boy/Girl field
should automatically enter a "She" and a "Her' in the repective fields in the
table.

Relatively new and forging my way here but not sure where to look for the
answer to this one. It's likely much easier than I'm trying to make it. Any
help appreciated. Thanks.
 
F

fredg

Hi. I've got a table with a bunch of fields including Boy/Girl, He/She, and
Him/Her. The Boy/Girl field is included in my form (but the He/She and
Him/Her are not on the form).

I want to set it up so that if I enter "Boy" in the Boy/Girl field on the
form it automatically enters "He" in the He/She field and "Him" in the
Him/Her field in the table. Like wise, a "Girl" entry in the Boy/Girl field
should automatically enter a "She" and a "Her' in the repective fields in the
table.

Relatively new and forging my way here but not sure where to look for the
answer to this one. It's likely much easier than I'm trying to make it. Any
help appreciated. Thanks.

That's not how Access has been designed to work.
There is no need to store the Him/Her or He/She information.
As long as you have the Boy/Girl value stored, anytime you need to
display the him or her on a form or report, you simply use unbound
text control with an expression to display the him or her as
appropriate.

=IIf([Gender] = "Boy","He","She")
=IIf([Gender] = "Boy","Him","Her")
 
C

creolejazz

Thanks. But the reason I need HIM and HE in the other fields in the table is
so that at some future time I can merge the table with a letter. The letter
would read, "we're glad HE came...we enjoyed HIS company...", etc. The "HE"
and "HIS" would come from the table fields. So, in my brain, all the table
fields need to be completed. I'm trying to get my mind around how this is
supposed to work. Thanks.

fredg said:
Hi. I've got a table with a bunch of fields including Boy/Girl, He/She, and
Him/Her. The Boy/Girl field is included in my form (but the He/She and
Him/Her are not on the form).

I want to set it up so that if I enter "Boy" in the Boy/Girl field on the
form it automatically enters "He" in the He/She field and "Him" in the
Him/Her field in the table. Like wise, a "Girl" entry in the Boy/Girl field
should automatically enter a "She" and a "Her' in the repective fields in the
table.

Relatively new and forging my way here but not sure where to look for the
answer to this one. It's likely much easier than I'm trying to make it. Any
help appreciated. Thanks.

That's not how Access has been designed to work.
There is no need to store the Him/Her or He/She information.
As long as you have the Boy/Girl value stored, anytime you need to
display the him or her on a form or report, you simply use unbound
text control with an expression to display the him or her as
appropriate.

=IIf([Gender] = "Boy","He","She")
=IIf([Gender] = "Boy","Him","Her")
 

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