Q: Change display of bounded textbox on form?

M

Mark

Hi,

I have a form with a set of textboxes bounded to a table. One textbox, for
example, is named RatingOverall (bound to a field named RatingOverall). The
values for this field range from 1 to 5.

On the form, what I'd like it to do is substitute
1 --> Poor
2 --> Okay
....
5 --> Excellent

I know I can do this programmatically using unbound controls, but the form
is already created with bounded controls and I was wondering if there's a way
to "wrap" a function to change the display, but keep the field value as is.

Note that users will not be able to change the textbox (ie. it's just
display), so that gets rid of one complication.

Thanks!
-Mark
 
M

Marshall Barton

Mark said:
I have a form with a set of textboxes bounded to a table. One textbox, for
example, is named RatingOverall (bound to a field named RatingOverall). The
values for this field range from 1 to 5.

On the form, what I'd like it to do is substitute
1 --> Poor
2 --> Okay
...
5 --> Excellent

I know I can do this programmatically using unbound controls, but the form
is already created with bounded controls and I was wondering if there's a way
to "wrap" a function to change the display, but keep the field value as is.

Note that users will not be able to change the textbox (ie. it's just
display), so that gets rid of one complication.


Set the text box's expression to:
=Choose(RatingOverall, "Poor", . . ., "Excellent")
and change the name of the text box to something else such
as txtRatingOverall

That quick and dirty answer has the disadvantage that if you
ever change your mind about having only five values or if
you want to change the text, you will have to modify the
text box's expression. A more robust solution is to have a
table with two fields for the rating number and the rating
text. Then base the form on a query that joins that table
to the table that you're now using.
 
M

Mark

Thanks Marshall,

Once I can get all these folks off the db, I'll try the function.

-Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top