View Full Version : Use code to determine value written to record from combo


home70
09-28-2007, 10:45 AM
I use a Value List for options in a combo box but I don't want exactly what is selected to be written to the record. I need each selection of the combo box to correspond to another value that should be written to the record. For example:
The combo options from the value list are Day(s), Week(s), Month(s), Year(s)
When Day(s) is selected in the combo box, I want "d" (w/o quotes) to be written to the record. When Week(s) is selected in the combo box, I want "w" (w/o quotes) to be written to the record. And so on.
How can I do this? Thanks.

pbaldy
09-28-2007, 10:50 AM
You want a 2 column combo with D in the first column and Days in the second. You want the first column to be the bound column but hidden (0 column width).

home70
09-28-2007, 11:04 AM
Thanks.
Can I still put the options in a value list, because I can't figure out how to do what you're saying and use the value list?

pbaldy
09-28-2007, 11:09 AM
Sure; the wizard should walk you through it. The value list would look like:

"d";"days";"w";"weeks"...

home70
09-28-2007, 11:13 AM
Thanks for your help pbaldy. I wasn't using the wizard, so I didn't see it.

Full answer for future searchers:

Row Source Type : Value List
Row Source : Day(s);d;Week(s);w;Month(s);m;Year(s);y
Column Count : 2
Column Widths : 1";0"
Bound Column : 2

The 0" width for the second column hides that column.