change text field to a check box

G

Guest

My database users want to change an existing text field over to a checkbox.
Right now, users are entering "Complete" for finished work items, and the
items are then transferred from the active table to the completed table.
What they want to do now is just check a box for completed items and have the
same result occur.

How would I create the check box so this would occur?

And how would I change the existing text fields in the workflow tables to
check boxes?
 
G

Guest

How would I create the check box so this would occur?
You can not. You need to add a new field and then update the new field
based on content of the old field.
It is best to have a single table and have your queries with criteria to
select those records you now move between tables.
 
G

Guest

Thank you for your reply. But how do I create a field in the table that
responds to the check box? It won't be a text or numerical field, right?
Then how do I change my queries so the criteria responds to the content of
the check box?
 
M

Marshall Barton

IC said:
My database users want to change an existing text field over to a checkbox.
Right now, users are entering "Complete" for finished work items, and the
items are then transferred from the active table to the completed table.
What they want to do now is just check a box for completed items and have the
same result occur.

How would I create the check box so this would occur?

And how would I change the existing text fields in the workflow tables to
check boxes?


Add a new Completed chek box field to the table (either
manually, using a VBA procedure or running an ALTER TABLE
query).

Then use an UPDATE query to set the new field's value:
UPDATE table SET Completed = (textfield = "Complete")

Then delete the textfield.
 
G

Guest

Open your table in design view. In a blank row add the new field name and
for type select Yes/No. A Yes/No field stores the data as a 0 (zero) or a
-1 (minus one).
Your queries will use -1 as criteria for Yes.
On your form select the field from the field list when you have it open in
design view.
 
J

John W. Vinson

Thank you for your reply. But how do I create a field in the table that
responds to the check box? It won't be a text or numerical field, right?

Use a Yes/No datatype.
Then how do I change my queries so the criteria responds to the content of
the check box?

Use a criterion of True (or synonymously, -1) for checked, False (or 0) for
unchecked.

John W. Vinson [MVP]
 
G

Guest

Thanks all, that really helped.

Marshall Barton said:
Add a new Completed chek box field to the table (either
manually, using a VBA procedure or running an ALTER TABLE
query).

Then use an UPDATE query to set the new field's value:
UPDATE table SET Completed = (textfield = "Complete")

Then delete the textfield.
 

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