Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    San Diego

    Question Unanswered: Check boxes and queries

    Greetings all,

    I have never used checkboxes on a form before, and am having a hard time searching the glorious net for answers. Here is the scenario. I have some results from a query showing up in a form, and I would like the user to be able to check which ones they would like to see more details on. After checking the desired boxes, the user would click 'OK' and another form or report would then display the details. I know I can do this with a list box using multiple selects, it just doesn't look as nice.

    Do I need to have a yes/no field in my table, or do I somehow bind the checkbox to a textbox, and if so, what is this process?


  2. #2
    Join Date
    May 2004
    Unfortunately, there are many ways to do it. I assume you are thinking of using a continuous form or a subform with a continuous form. You can either:
    1) have a Yes/No field (boolean) in the underlying table (if it is single user, etc) in which case you bind the checkbox to the boolean field, or
    2) use a temp table (potentially for each user) and bind per #1. There may be a way to use unbound checkboxes but nothing simple comes to mind.

    If you use #1 you have to reset the booleans to false when you are done so that they do not show up as chosen the next time. If you use a temp table you will empty and repopulate the temp table each time. Using a temp table would be the most flexible (e.g., can use the temp table to do a join with the result, form and code can be reused in other cases). We do this for allowing users to pick Customers to be included in a report all the time; it is a handy general utility to have around.

    Also, remember to set the boolean field or checkbox to default to False rather than letting it default to Null which can confuse both the user and developer.

Posting Permissions

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