Results 1 to 9 of 9

Thread: Report Query

  1. #1
    Join Date
    Dec 2003
    Posts
    20

    Unanswered: Report Query

    Can someone help. I have a table with a number of fields to track problems on the production floor. One field that I query to is called "cell". We have numberous cells and I would like to set up a form with checkboxes with the name of each cell and would like to click on a number of cells but not all and run a query to a report. Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    Caldes de Malavella, Spain
    Posts
    244
    A much better idea would be to :

    1) Create a table with the names of all your cells in. Present the contents of this table as a multi-select list box in a form and then write some code to loop through the ItemsSelected collection of the list box to find out which were selected. From this build an SQL string to use as criteria for your report.

    2) Slight variation: instead of using a Cells table, make the row source of your list box display cells that have been entered in your data only, thus negating the need to display cells that have never been entered in the actual data.


    I hope this gives you something to think about.
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy
    http://www.elmhurstsolutions.com

  3. #3
    Join Date
    Dec 2003
    Posts
    20
    Thanks for the input but I am new to writing code. Do you have any ideas on writing code for this. thanks

  4. #4
    Join Date
    Feb 2004
    Posts
    42
    Originally posted by dwegst
    Thanks for the input but I am new to writing code. Do you have any ideas on writing code for this. thanks
    I am also trying to get a query to work based on a multi select list box (as suggested above). Does anyone have same code for this? I have no problem getting setting up the multi select list box, I know how to get the data (which items were selected), but I don't understand what to do with it, or how to get the query to run based on that information.

    Thanks for any help!!!

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by accessnoobie
    I am also trying to get a query to work based on a multi select list box (as suggested above). Does anyone have same code for this? I have no problem getting setting up the multi select list box, I know how to get the data (which items were selected), but I don't understand what to do with it, or how to get the query to run based on that information.

    Thanks for any help!!!
    That depends on what is in the listbox ... Are the listbox items for a single column or for multiple columns of a table(s)?

  6. #6
    Join Date
    Feb 2004
    Posts
    42
    Just one column of data in the list box...it is Status for work to be done. So the options are:

    Complete
    Closed
    InProgress
    Hold
    WaitingApproval

    etc

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by accessnoobie
    Just one column of data in the list box...it is Status for work to be done. So the options are:

    Complete
    Closed
    InProgress
    Hold
    WaitingApproval

    etc
    That wasn't what I asked ...

  8. #8
    Join Date
    Feb 2004
    Posts
    42
    My bad...They are for a single column.

  9. #9
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by accessnoobie
    My bad...They are for a single column.
    Ok ... Well then what you do is iterate thru the selected items and build a WHERE clause. You'll have a SQL statement like:

    ... WHERE ([MyFieldName] IN ( Item1, Item2, Item3, ... , ItemN));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •