You told me so...

S

Stephanie

The shame. I had a type that I thought was one or the
other. Rather than doing it right, I used yes/no for each
type (too lazy to rewrite queries). Now I find out that
the type can be "member", "affiliate" or "both".

What is the best way to handle this? Option group?

Thanks,
Stephanie
 
G

Guest

Probably, but it depends if this list of three may expand in the future. If
so a list box would be better, as there would be less to do. You would simply
make the list box taller.
 
S

Stephanie

Interesting. I'm familiare with combo boxes but I've not
used a list box before, so let me ask a couple of
questions. I know how to do combo boxes and they take up
less space than a list box. Any big advantage of one over
the other here?

For either one, I imagine I need to set up a new field to
bind the box to, or is this where I could have it unbound
and just have the row source with the correct query info?
Normally, I would set up a new table, put the FK in my
main table, and create the combo bound to the key.

I have code that will key off the box value: where "type"
equals "handler". Can I do this with a list box as well?

Thanks for taking the time- I appreciate it. Stephanie
 
R

Rick Brandt

Stephanie said:
The shame. I had a type that I thought was one or the
other. Rather than doing it right, I used yes/no for each
type (too lazy to rewrite queries). Now I find out that
the type can be "member", "affiliate" or "both".

What is the best way to handle this? Option group?

Thanks,
Stephanie

I never use Yes/No (or bit) fields any more, but use integers instead. They can
be bound to checkboxes just like Yes/No, but if/when I need more than two
choices all I have to do is change control type.
 
S

Stephanie

Interesting, but I dont' get it. How do you assign the
integers and what do you mean by changing control type.
You see, I'm trying to do this correctly this time! Thanks
 
R

Rick Brandt

Stephanie said:
Interesting, but I dont' get it. How do you assign the
integers and what do you mean by changing control type.
You see, I'm trying to do this correctly this time! Thanks

A CheckBox, RadioButton, or ToggleBox assign a negative one to their bound
field when set to True and a zero when set to False. They can do this when
bound to a Number field as easily as if bound to a Yes/No field. The
difference is if it is later discovered that the field needs to support more
than two possible states a Yes/No field cannot do this so you are forced to
change the DataType. If a Number field is used all you have to do is
replace the CheckBox, RadioButton, or ToggleButton with a control that
allows for more than two choices. Either a TextBox, ComboBox, ListBox or
OptionFrame.
 
S

Stephanie

I see what you're saying. I changed my 2 fields, Member
and Affiliate, from yes/no to number fields. Before I
had yes = -1. Now what do I have?

Since I already have 3 choices (Member, Affiliate and
Both), it seems like I'd be better off to create a new
table with these 3 choices so I can use a combo box to
select. I'd certainly know the "value" of the ID after
AutoNumber assigned it and I could change my code from
something like if Member = -1 to if TypeID = 2...
Correct? Thanks, I think I may be getting it! Stephanie
 

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