drop down list box problem

M

Mike_D_Man

This is a re-posting of a question asked on the 20th, but things have
changed a little.

Here is an example table.

1 - Text
2 - Covers
3 - Jacket
4 - Insert

The codes (1-4) are what is real important, but the people filing out
the form need to know what those codes mean. Right now, these are in a
table at the bottom of the form that they fill out manually. My idea
was to put these in a pull down list box. However, while I need the
users to see the text, I only need to capture the number. One would
think that if I set the value to "1" and the display name to "text"
that I should get what I want. However, when I do this, the form
stores the "text" and not the number.

How can I /should I do this?
 
T

Terry

Hi Mike,

This is really easy to do. all you do is set a value of 1, 2, 3 and 4
but set the display name to the description.

Terry
 
R

Russ

You can check that it works by inserting an expression box into your form,
and setting the datasource of the expression box to your drop-down list box.
If you've set the values correctly, they should appear in the expression box
when you preview the form and select different items from the list box.
 
M

Mike_D_Man

Thanks to both of you. However...

I was already doing what Terry suggested. I go to fill out the form
using the drop boxes I have created. Then I go to print view to see
what I will get. In the print view, the options chosen (the text) are
still showing, and not their corresponding variables. So, using the
example previously given, I chose "Text", but instead of seeing "1" in
that field in print view, I am seeing "Text". However, when I used
Russ's idea to test it, I did get the results he suggested: the
expression box contains the "1" even as the field in the form (the
drop down list box) shows "Text".

I did not have this issue when I was using a Master:Detail control to
enter the date: the field in the Master would show "1". However,
remember that I ultimately I want the lists at the bottom of the form
to go away? Well, the same applied to the detail section. The best
solution for me would be to have a way to make the detail section not
be present. Can I insert a control to close the detail section just as
there is one to open it? Or should I instead create a new view (for
printing) that does not show the detail section?
 
R

Russ

There's probably more than one way to do this, but creating a seperate print
view is the one that I would choose. It seems like it wouldn't be too hard
to just copy most of your default view to a new print view, but use the
expression box I mentioned before to display the value where you need it.
 
M

Mike_D_Man

Thanks, Russ. I am going to go with that. Just so you know, though,
when using the drop down list boxes on the detail like that, it does
populate the corresponding field on the master with the proper value
and not the display name.
 
B

BronwenZ

Hi, The other thing we do in this situation is for every id to have a
corresponding description attribute in the schema, and in the onafterchange
of the drop down set the description attribute to the text value. Then on
the print view we bind to the description attribute rather than the id.
 

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