Form Field Numeric Value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a field (Field A) that has a list box with values such as
apple, orange, and bannana. In field B I would like it to display
automatically a 1 if apple is selected in Field A, a 2 if orange is selected
and so on. How can I do this? Thanks for any help.
 
Todd,

Is your listbox control reading its values from a table. or did you just
type them in?

In the former case: add a field in the table and key in the numbers. Then
open the form in design view, select the listbox, display the properties
window, go to tab Data, put the cursor in the RowSource property and click
on the little button on the right to invoke the query builder. In the query
design view, add the numeric field first, then the text field and close
(confirm to save). back in the listbox's properties, leave the Bound Column
property to 1 (or change if different), then go to the format tab and set
the Column Count property to 2, and set the Column Widths property to
something like 0;2 (or any number > 0 that suits yor design). Setting the
first column's width to 0 reults in it not being displayed, so you only see
the texts, while the value returned is the numeric value from the first
column, as set in the Bound column property.

In the latter case: rebuild the listbox in order to re-invoke he wizard; set
the number of columns to 2, fill in the first with the numerals and the
second with the text, in the next step (which selects the bound column)
select Col1, and after the wizard has finished set the Column WWidths
property like in the previous case.

HTH,
Nikos
 
Back
Top