How to display text in a list box and return a # in a Form

loderdodger

New Member
Joined
Jun 9, 2008
Messages
7
I am trying to have a drop down list with various choices in text, e.g. Male and Female in a form for entering data. However, in the table, I would like the return values to be 1 if it is Male, and 2 if it is Female. Does anyone know an easy way this is done? Thanks in advance.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
If you make the list a ComboBox and use a table as it's source, you could make the table with a list of Male, Female etc...and add a second field to number them; 1, 2...

You could then have the combo box display the 1st column, but be bound by the 2nd column.

As an example:

Row Source Type: Table/Query
Row Source: UtilityFormNameLookup
Column Count: 2
Column Widths: 1";0"
Bound Column: 2

where the 2nd column is the numbered one.

I believe this will work, but I can't guarantee because I don't have a handy example in the databases I use.
 
Upvote 0
In lieu of a combo box, you could use radio buttons in a frame. This gives you options and automatically sets up to give you the value in a query, report or table of 1, 2, 3 etc based on the option selected.
 
Upvote 0

Forum statistics

Threads
1,216,080
Messages
6,128,692
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top