Results 1 to 2 of 2
  1. #1
    Accessbeginner23 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Location
    Wisconsin
    Posts
    2

    Arrow Filtering records on a split form

    Good morning,



    I am new to this forum. I guessing someone here can help me with a problem that I'm having. I am designing a access database that will track warranty claims for the company that I work for. I have a form created where I enter in the warranty claims to be filed. The record source for this form is a query. I have a combo box on the form that sets the status of the warranty claim to To Be Filed, Filed, Accepted, Rejected, or Missing Information. I want to be able to set a filter on the form so either it will show all claims waiting to be filed, or it will be able to show all claims regardless of their status. I have a checkbox on the form called chkShowall. If the checkbox is checked, the form should show all the records. If it is unchecked, only the records showing the status "To Be Filed" should show. On the click event of the checkbox I have the following code. I have very simple code so far with no error handling events or anything else.

    If chkShowall.value = True Then
    txtshowall.vaule = "*"
    Else
    txtshowall.vlue = "To Be Filed"
    End If

    DoCmd.requery

    The criteria field for the status field in the query is pointed to the text box on the form

    When I run the query all by itself and put the * in the criteria field all of the records show up. However when I run it from the form, none of the records show. What is the matter with my code? Can someone tell me.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You have a parameterized query? I avoid them and never done anything like this. Note that Access supplies the LIKE why you type only * directly in the query. So I expect the wildcard criteria needs Like operator when setting criteria programmatically.
    Me.txtshowall = "LIKE '*'"

    My preferred alternatives:

    1. Revise the RecordSource statement of the form

    2. Set the Filter and FilterOn properties of form - review http://allenbrowne.com/ser-28.html
    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.

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

Similar Threads

  1. Replies: 15
    Last Post: 04-17-2012, 01:42 PM
  2. Replies: 9
    Last Post: 12-19-2011, 06:30 PM
  3. Replies: 3
    Last Post: 08-23-2011, 04:35 PM
  4. Replies: 0
    Last Post: 02-09-2011, 03:10 PM
  5. split form select records based on a criterea
    By ramkitty in forum Access
    Replies: 8
    Last Post: 03-12-2010, 06:19 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