Results 1 to 4 of 4
  1. #1
    rocky143ch is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2014
    Posts
    4

    Controlling Query Output Using checkbox or radiobutton


    Hello guys,

    I have been using access do develop applications for my personal use. Recently I had developed a application which has a query which consist of nearly 15 fields as output. I have designed a form with 15 checkboxes or radiobuttons and named the controls with field names and had a runquery button.

    Now My question is, how to assign each field to checkbox or radiobutton so that whenever I check a checkbox or radiobutton and hit the runquery only that fields should display as result query and rest of the other fields should not be displayed in my query because sometimes I need only 5 fields as my output in my query and sometimes 8 and sometimes all the 15 fields. How to do this please explain me in detail with an example.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I use Yes/No fields to define the status of a record and said status may cause the record to be retrieved or not. The idea to this approach is to STORE data in the table so any user that goes to view a dataset will see a consistent result. The status is stored in the table and updated as the record's status changes. If a user is working on billing customers, they do not want to be stumbling over records that have already been billed.

    The other side of the coin is to retrieve data based on a user's criteria. Criteria based on a user's preference should not be stored in a field in a table but, stored as a variable in memory and applied to the query. Storing a user's preferred criteria in a table is not advisable. A user may want a report of historical data and want this data to include records that were billed AND are about to be billed.

    If a user wants to retrieve data from a table that has a field named [Author], you might provide an unbound control for user input. This unbound control would then be incorporated with the query as a variable. A simple way to see this in action is to create an unbound form and place an unbound control on it. You can then create a Dynamic Parameterized Query that references the control on your new form. While the form is open, you can open the Query and the Query will take into consideration the value of the referenced control.

  3. #3
    rocky143ch is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2014
    Posts
    4
    I did not got the answer for which I am waiting. Tell me if there is any way to break big query i.e., 10 columns query into 5, 7, 8 etc., based on requirement using checkboxes or radio button.

    Finally In query design mode we had an option ' show ' to hide or display the query field, now is there any way to check or uncheck using form controls without entering in querydesign mode..

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Yes and yes.

    How the query is created and or modified can depend on many factors.

    Is your form a bound form? Are your controls bound controls? Can you go to SQL View of your Query and post your SQL here?

    Also, whether or not a specific column is relevant is usually managed in a WHERE clause or HAVING clause that will decide if a RECORD/ROW is retrieved or not. Get user input via unbound controls to create criteria.

    Deciding whether or not to display a field on a form can be decided using the .Visible property of a bound control. I can not remember a time I have determined the .Visible property of a control based soley on criteria in an SQL statement. I use VBA to validate data retrieved and then determine the .Visible property of bound controls.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 12-30-2013, 05:51 PM
  2. How to query for this output?
    By seemi143 in forum Queries
    Replies: 1
    Last Post: 12-04-2013, 02:37 AM
  3. Checkbox output to text in table record?
    By coronatus in forum Forms
    Replies: 6
    Last Post: 10-27-2012, 08:56 AM
  4. Controlling autonumber
    By Patience in forum Access
    Replies: 3
    Last Post: 06-22-2010, 04:11 AM
  5. Checkbox controlling text box
    By chuckduarte in forum Forms
    Replies: 0
    Last Post: 10-21-2008, 10:45 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums