Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Filtering Data

  1. #1
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    15

    Question Unanswered: Filtering Data

    Okay everyone, you have a newbie on your hands here.

    I have a form that is filtered to only show records when [coded] checkmark = True - This is done via a macro.

    What I need now, in VB, is some serious help in how to not show the records when all of the check marks = True

    I would also like to place the first part of this question from the Macro to a VB statement as well. Please help.. This is very important as I can't move forward without it. Thank you very much.

    P.S. I am not a SQL person or a VB person, I am just now learning and I am learning by examples. Thanks again.....

    James

  2. #2
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Let me get this straight...

    Okay you are wanting to show records only if they are checked? (you already have a macro that does that, but you want it in VB or VBA?)

    Also you are wanting it not to show if all of the check marks are checked, correct?

    Please correct me if I am wrong on the above information. I am somewhat of a newb and am doing the same as you learning from examples. I hope I may have an example that will help you.


    Hope I can help,
    Jarvis
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  3. #3
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    15
    right on the money....... If you can help me with this I can get this hurdle behind me.

    Thanks

  4. #4
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    One last question...

    Are you using VB or VBA? (I will go ahead and post what I have in VBA)
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  5. #5
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    15
    I am using MS Access, so VBA I assume.

  6. #6
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Query

    Is your form running off of a query? If it is you can setup criteria to do what you need (I think).

    GRR my mind has gone blank!! I will see what I can find on my computer. I am sorry :-/

    J
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  7. #7
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    15
    Nope. The form is running straight from a linked table from another MDB.

    James

  8. #8
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Okay...

    Okay I will see if we can walk through this step by step.

    Can you create a query that has all of the fields you need from that table?

    Once you create it open it in design view and let me know.

    (you may also be able to put somekind of if statement in the current form in the filter, but since I havent worked much with filtering, I dont know).

    J
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  9. #9
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I can't get my head around what you need exactly... but to set a boolean value, you could run a small check with the count function:

    SELECT COUNT(yourField)
    FROM yourTable
    WHERE yourField = 0

    If the answer is 0, then al of the fields are checked.

    The VB application of this would use the DCOUNT() function:

    DCOUNT(yourField, yourTable, 0) = 0

    I really don't know where else to direct you as I don't understand exactly what you're trying to do.

  10. #10
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    15
    Here is the problem that I am running into... I dont want to run this based off of a query as I am running this over a network with approx. 20 users. Running this through a query kills my network. Any other ideas...

    James

  11. #11
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by James4582
    Here is the problem that I am running into... I dont want to run this based off of a query as I am running this over a network with approx. 20 users. Running this through a query kills my network. Any other ideas...

    James
    You want to evaluate a dataset without evaluating the dataset?


    No, I don't really have any other ideas.

  12. #12
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Clarification... (Hopefully)

    Hey Teddy I will try and clarify for him...

    He has a form that is currently 'filtered' to only show the records that have this certain y/n field on the yes. (using a macro)

    He want to take that macro out, and use a VBA function instead to do the same thing (limit the records to only those that are checked)

    He also wants the form to show nothing if all of the records are checked.

    Hope that helps a bit,
    Jarvis



    Originally posted by Teddy
    I can't get my head around what you need exactly... but to set a boolean value, you could run a small check with the count function:

    SELECT COUNT(yourField)
    FROM yourTable
    WHERE yourField = 0

    If the answer is 0, then al of the fields are checked.

    The VB application of this would use the DCOUNT() function:

    DCOUNT(yourField, yourTable, 0) = 0

    I really don't know where else to direct you as I don't understand exactly what you're trying to do.
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  13. #13
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Hmm...

    I dont have ne ideas as of yet.


    Hey teddy can you put VBA code in a filter box?

    If so then couldnt he write a vba function that says if they are checked then show them and if all are checked show nothing?

    J
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  14. #14
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1

    Re: Hmm...

    Originally posted by JSThePatriot
    I dont have ne ideas as of yet.


    Hey teddy can you put VBA code in a filter box?

    If so then couldnt he write a vba function that says if they are checked then show them and if all are checked show nothing?

    J
    I'm still having trouble conceptualizing what he wants to do.


  15. #15
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    When you open a form's properties. There is a place where you can filter the information. In that place is it possible to put VBA code such as an IF statement? :-/ I am sorry I cant think of any other way to explain it.

    He is trying to Sort on a check box without using a query, but by using a form some how.

    J
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •