check box value in a query

B

BCiel

I am working in Access 2003 and have a table with a large number of columns.
I am ultimately trying to create a table from a query with only some of the
columns.

I am creating a form with each of the column names listed with a checkbox.
Then based on which boxes are checked have the query pull only those columns
so that the table can be exported into a spreadsheet.

How do I reference the checkbox in the query to read whether the box is
checked or un-checked? I have tried a number of ways based on other
discussion questions and still seem to be doing something wrong.

The form is connected to the query so when the command button is clicked it
opens the query which is empty.

Hope this is clear enough for someone to help. Thanks
 
B

BCiel

Thanks. The -1 or 0 works to read the checkbox but it now gives all the
columns whether they were checked or not.

Is there a way to determine fields in the output of the query. For
instance, if I have name, address, city, state, zip, phone. and I only want
name and phone to appear in the new table to export. How can I check those
two boxes in the form and get just that data??

Different people will be using the big table and need different information
at different times for different reasons.

Thanks
 
K

KARL DEWEY

I do not know a method to do what you are asking. Maybe someone else may
know how.
 
B

Bob Barrows

BCiel said:
I am working in Access 2003 and have a table with a large number of
columns. I am ultimately trying to create a table from a query with
only some of the columns.

I am creating a form with each of the column names listed with a
checkbox. Then based on which boxes are checked have the query pull
only those columns so that the table can be exported into a
spreadsheet.

How do I reference the checkbox in the query to read whether the box
is checked or un-checked? I have tried a number of ways based on
other discussion questions and still seem to be doing something wrong.

The form is connected to the query so when the command button is
clicked it opens the query which is empty.

Hope this is clear enough for someone to help. Thanks

You will need to use VBA code to build the sql statement for the query to be
exported. Do a search over at www.rogersaccesslibrary.com for examples.
 

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