Option Groups

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

Guest

Hi.....I've created an option group on a form with 6 possible choices. It is
bound to a field in a table and seems to be working fine except when i
generate a report from this table, it prints the numerical value from the
option field but i'd prefer the text. Any ideas how to get around this guys ?

Thanks,
Jenny
 
Jen said:
Hi.....I've created an option group on a form with 6 possible
choices. It is bound to a field in a table and seems to be working
fine except when i generate a report from this table, it prints the
numerical value from the option field but i'd prefer the text. Any
ideas how to get around this guys ?

Thanks,
Jenny

Either use the Choose() function or create a small table that holds the numeric
values as well as the text and add that table to your query.
 
In the query on which your Report is based, create a new field
something like

OptionName: =OptionNameFunction(OptionField)

In a standard module, create a Function Procedure
OptionNameFunction(OptionField as integer) as String

in that function, use a SELECT .... CASE procedure to assign the
appropriate string for the value returned in OptionField.

In your Report, where you currently use OptionField (which returns an
integer) use your new field OptionName.

HTH
 
Back
Top