Convert COMBO BOX to CHECK MARK

G

Guest

I'm trying to create an alumni form from my database. I used the wizard to
create a form, but I want to have the form SHOW the items in the combo box
instead of having them drop down.

For example, I have a field called CONTACT TYPE which allows me in the TABLE
to select either ALUMNI, PARISHIONER, PARENT, etc. Now, when I used the
wizard to create the form, it made a COMBO BOX and has the items to be
selected (alumni, parishioner, parent, etc) in a drop down list (like it is
in the TABLE datasheet view). But, I don't want this. I want the FORM to
SHOW the items to select from with a CHECK MARK box next to them.

How do I do this?
 
S

Steve Schapel

Smags,

Remove the combobox from your form, and replace it with an Option Group
bound to the Contact Type field. Put your 3 checkboxes within the
Option Group, and edit the labels as required.

This is a good method, but it requires a little extra effort. You have
to remember that the data entered into a table using an Option Group are
numbers. The number entered is controlled by the Option Value property
of each of the checkboxes. For example, Alumni will be entered into
your table as 1, Parishioner as 2, and Parent as 3. That means you
should go to the design view of the table and change the Date Type of
the Contact Type field from Text to Number. The way I would normally
handle this, then, would be to make another simple table, 2 fields and 3
records, to list the numbers 1, 2, 3 and the associated Contact Type
data. And then you will need to include this table into the query
whenever you need the word "Alumni" etc to be shown on a form or report.
 
G

Guest

When you speak of adding another simple table is that also known as a
sub-form? I'm new to this.
 
S

Steve Schapel

Smags,

No, a subform is a form that is embedded as a control on another form.
This is an entirely different concept. I am just suggesting you make a
new Table. It would have 2 fields, let's say you call them
ContactNumber and ContactText, and then enter 3 records like this...
1 Alumni
2 Parishioner
3 Parent

That's it. It is for cross referencing to the Contact Type field in
your main table, which will now contain a numerical value, so you can
easily determine the contact type in words. Hope that clarifies.
 
G

Guest

OK thanks.
--
smags


Steve Schapel said:
Smags,

No, a subform is a form that is embedded as a control on another form.
This is an entirely different concept. I am just suggesting you make a
new Table. It would have 2 fields, let's say you call them
ContactNumber and ContactText, and then enter 3 records like this...
1 Alumni
2 Parishioner
3 Parent

That's it. It is for cross referencing to the Contact Type field in
your main table, which will now contain a numerical value, so you can
easily determine the contact type in words. Hope that clarifies.
 
G

Guest

Regarding "put your 3 checkboxes WITHIN the Option Group, and edit the labels
as required," do I have to edit any references under the preferences once I
add a checkbox within the option group?

I deleted the combo box, clicked on option group and dragged it where I
wanted it, changed the control source, and then clicked on check mark and
dragged it into the option group and changed the label of it. Is that it?
 
S

Steve Schapel

Smags,

Yep, that sounds like the one. When you drag the checkbox over the
Option Group, the back color of the Option Group will change, and that's
when you should drop it. Do it 3 times, i.e. add your 3 checkboxes to
the Option Group. If you look at the Properties of the checkboxes, you
will see an Option Value property, and most likely the 3 checkboxes will
have Option Values of 1, 2, and 3. When you select one of the
checkboxes, the Option Value of that checkbox is the data that will be
written to the table. Because this is a number, as I mentioned before,
you should change the Data Type of the field that the Option Group is
bound to (Control Source) to Number data type.
 
G

Guest

It's not showing a checkmark next to any of the options. I must not be tying
the info together.

Can you please explain which line/property item(s) in the properties of each
box (option group and check box) need to be edited and with what answers?

For example, I have a LABEL called Gender. The OPTION GROUP has the line
item CONTROL SOURCE and I answered Gender. The first CHECK BOX (male) within
the OPTION GROUP has a line item OPTION VALUE which I answered 22 (because
this is the number it assigned when I created a TABLE called GENDER TYPES).
The LABEL for this check box is called Male. The second CHECK BOX (female)
within the OPTION GROUP has a line item OPTION VALUE which I answered 23
(because this is the number it assigned when I created a TABLE called GENDER
TYPES). The LABEL for this check box is called Female.

When I am in the form looking at FORM VIEW there isn't any checks in the
gender boxes, yet the data is there in DATASHEET VIEW (Male, Female).

What am I missing?
 
S

Steve Schapel

Smags,
When I am in the form looking at FORM VIEW there isn't any checks in the
gender boxes, yet the data is there in DATASHEET VIEW (Male, Female).

What data is there in datasheet view? As I mentioned before, the Gender
field needs to be a Number data type, and using your example, the data
you see will be 22 for males and 23 for females. Is that what you've got?

Having said that, you should be able to edit the number values in your
Genderr Types table (unless it is an Autonumber, and if it is, there is
no need for it to be), so it is 1 and 2 or something a bit more
relateable than 22 and 23!
 
G

Guest

I did not change the DATA TYPE to NUMBER. When I tried to do this, it said
it would delete two records (which it deleted Male and Female). I did this
in the GENDER TYPES table I created. When I'm in the CONTACTS table, which
pulls from the GENDER TYPES table, I tried to change THAT Gender to Number
also and it said too many fields to define (I have 1500 Contacts/records).

Now what?
 
S

Steve Schapel

Smags,

Under the Tools menu, Comapct your database.

I did not realise that you already had all these records in the table.
What is the data in the Gender field at the moment... "male" and
"female"? Whatever, you should first run a couple or Update Queries to
update the data to "22" for "male" and "23" for "female". Then change
the data type of the Gender field in the Contacts table to Number.
 
G

Guest

I'm new to this, so thank you for the correction. I looked up updating
queries and understand what it is doing.

BUT, the first thing I did was change, in DESIGN VIEW, the DATA TYPE to
NUMBER. It keeps giving me an error saying xx records have been deleted, do
you want to continue? and I say no. Does this really mean records have been
deleted even though I said NO to continuing? And why am I getting this
error? Should I have done UPDATE QUERIES first before changing DATA TYPE to
number?
 

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