Can one form control create entries in three table fields?

creolejazz

Registered User.
Local time
Today, 13:24
Joined
Jun 28, 2007
Messages
55
Learning my way through Access 2007 and wonder if you can help me with this. (I'm guessing it's simple.)

I have a table that contains several fields including "Boy/Girl", "He/She", and "Him/Her". I have a form that contains the control "Boy/Girl".

How do I configure the form so that when BOY is entered in the "Boy/Girl" control, HE is automatically entered in the "He/She" field and HIM is automatically entered in the "Him/Her" field in the TABLE?

Any help appreciated. Thanks.
 
Do a search on the IIF function on this forum, Access Help or Google and heaps of stuff will come forward.

Normally that type of data is not stored in the field of a table, it is done in a calculated field made in a Select query or in an unbound textbox on a form.

A very simple IIF for your situation is:

As a new field in a query

Gender:IIF([FieldNameBoyGirl] Like "Boy","He","She")

In an unbound textbox

=IIF([FieldNameBoyGirl] Like "Boy","He","She")

As you can see it is a True/False expression.

However you need to go further than that because as Gizmo pointed out you could have lesbians, gays and transvestites? In the above example of IIF entering Boy will produce He but any other entry will produce She.

When you search around for IIF also looked for "nested IIF"

I would strongly advise you to search around for IIF and also setting conditions. Unless you can do these things then a data base at best will be extremely limited.
 

Users who are viewing this thread

Back
Top Bottom