Results 1 to 4 of 4
  1. #1
    NateHaze is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    6

    Checkbox help

    Hello,


    I'm trying to create a form that's kind of like a survey. A simple example:

    Name:
    Age:

    Colors you like:
    (Checkboxes for blue, green, red, yellow)

    Numbers you like:
    (Checkboxes for 1, 2, 3, 4)


    Let's say Bob is 9 and likes green and yellow and numbers 1 and 4.The report should print out:

    Hello, Bob!

    You are 9 years old.

    You like the following colors:
    green
    yellow

    You like the following numbers:
    1
    4

    I'm not sure how to get the checkboxes to pass the values to a table when checked. Any ideas?

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Okay!

    The easy way is to achieve this is creating a new text field for each check box and store the check box's data to the appropriate field.
    For example: color checkbox, blue, green and red, yellow... you can save the caption of the checkbox to those fields when clicked.

    private sub checkboxgreen_click()
    FieldColorGreen.Value=checboxGreen.caption
    end sub

    This an aircode, but hope will give some idea.

  3. #3
    NateHaze is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    6

    Requesting more help...

    Thanks for the quick response. I am able to pass the values now! However, I don't know how to format the report so that it only prints the relevant data. One part of my example was:
    You like the following colors:
    green
    yellow

    How do I display only green and yellow without a bunch of space where the blue and red fields would be if they were selected as well? It's like I need to create a dynamic query that only grabs columns that aren't null...

  4. #4
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Yeah, and one approach is to create a Sub Report on the main report where the data will come from your subTable, (you would have definitely created the main table and sub-table with foreign key and primary key relationship)

    Hope this help.

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

Similar Threads

  1. QBF - Checkbox
    By radink in forum Queries
    Replies: 17
    Last Post: 04-19-2011, 03:47 PM
  2. Checkbox
    By Patience in forum Access
    Replies: 5
    Last Post: 06-22-2010, 05:37 AM
  3. Using a checkbox help
    By gbjc105 in forum Forms
    Replies: 1
    Last Post: 01-28-2010, 08:27 PM
  4. Checkbox
    By Rbtsmith in forum Access
    Replies: 2
    Last Post: 02-17-2009, 04:19 PM
  5. checkbox
    By Suresh in forum Forms
    Replies: 0
    Last Post: 12-19-2007, 01:30 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