Results 1 to 3 of 3
  1. #1
    WhiskyLima is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Location
    UK
    Posts
    32

    Checkbox for incomplete tasks only

    Hey all! Im working on a basic filter in a task list. Firstly please forgive my strange naming conventions, I have had no formal training in access so I just make it up as I go along.

    Anyway, what im after is a check box called [onlyComplete] which is located at the top of a task list called [All Tasks]. The idea is that 'After Update' on this checkbox, the Me.Requery kicks in. The criteria for the query is based on the 'complete' field and looks like this:



    Code:
    IIf([Forms]![All Tasks]![onlyComplete]=-1,0,<1)
    Now this is supposed to display either the incomplete tasks only or all the tasks, however it is either displaying the incomplete or complete but not both.]

    Im sure its something stupid im missing here, like I say Im quite new to this and I have only a basic understanding of the coding etc.

    Any help is as always appreciated guys! Many thanks in advance

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    This is criteria in query? Suggest that you don't use dynamic parameterized query - I never do (I don't think this conditional criteria can be made to work). Use code to set the Filter and FilterOn properties of form, I use only VBA, like:

    Me.FilterOn = False
    If Me.onlyComplete = True Then
    Me.Filter = "Complete=0"
    Me.FilterOn = True
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    WhiskyLima is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Location
    UK
    Posts
    32
    That works like a charm, thank you very much! I can see how this Filter code could be very useful to me actually because Im thinking about using a few filters on the same form and using a query to organise all the filters would have been a nightmare, this makes much more sense!

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

Similar Threads

  1. Completed tasks
    By tfanara in forum Access
    Replies: 3
    Last Post: 08-21-2013, 02:29 PM
  2. Scheduling/Tasks
    By Pietleeu in forum Access
    Replies: 4
    Last Post: 02-28-2013, 01:26 AM
  3. Incomplete form
    By jinz in forum Forms
    Replies: 11
    Last Post: 12-12-2012, 09:06 AM
  4. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  5. Generating reports by incomplete field
    By mathonix in forum Reports
    Replies: 2
    Last Post: 01-28-2010, 06:37 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