A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old April 3rd, 2008, 09:45 PM posted to microsoft.public.access.forms
creolejazz
external usenet poster
 
Posts: 6
Default If/then-type situation. IF in this field, THEN THIS in that field?

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.
  #2  
Old April 3rd, 2008, 11:35 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default If/then-type situation. IF in this field, THEN THIS in that field?

On Thu, 3 Apr 2008 13:45:00 -0700, creolejazz wrote:

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")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old April 4th, 2008, 02:22 AM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default If/then-type situation. IF in this field, THEN THIS in that field?

Since these really are "calculated" fields, they are not necessary in your
table. Use a query to create the values any time you need them.

creolejazz wrote:
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.


--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200804/1

  #4  
Old April 7th, 2008, 10:04 PM posted to microsoft.public.access.forms
creolejazz
external usenet poster
 
Posts: 6
Default If/then-type situation. IF in this field, THEN THIS in that fi

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" wrote:

On Thu, 3 Apr 2008 13:45:00 -0700, creolejazz wrote:

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")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.