Results 1 to 4 of 4
  1. #1
    brow1726 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    13

    Arrow Using Check boxes for an if statement


    So I have a set of 5 queries that need to be ran. Each of which has a counter part to filter out training results. What I want to do is run a check box that when checked will run query that filters and when not checked runs the normal query.

    Here's what I have right now.

    For the Checkbox:

    Code:
    Private Sub UncheckedBox()
    Dim TrainingCheckValue As Integer
    TrainingCheckValue = TrainingCheck.Value
    End Sub
    For the if statement I have:

    Code:
    If TrainingCheckValue > 0 Then
    DoCmd.OpenQuery "TotalsScanTrain"
    Else
    DoCmd.OpenQuery "TotalsScan"
    End If
    
    End Sub
    I was trying to use the code for the check box to return a zero when unchecked and non zero when checked to use with the if statement but that isnt working for me.

    Any Ideas anyone??

    Thanks in advance,

    Matt

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Access stores True as -1.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    brow1726 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    13
    Thanks alot

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Check Boxes
    By manic in forum Programming
    Replies: 5
    Last Post: 06-26-2012, 09:18 AM
  2. Yes/No check boxes
    By Desstro in forum Forms
    Replies: 2
    Last Post: 05-03-2010, 04:26 AM
  3. To check or Un-Check all Boxes in a form
    By devcon in forum Forms
    Replies: 7
    Last Post: 05-01-2010, 12:03 AM
  4. Un-Check all Boxes
    By cotri in forum Forms
    Replies: 4
    Last Post: 04-30-2010, 12:53 PM
  5. check boxes
    By chiefmsb in forum Forms
    Replies: 1
    Last Post: 11-14-2006, 02:22 PM

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