Results 1 to 9 of 9

Thread: Search in BD

  1. #1
    Join Date
    Nov 2013
    Posts
    6

    Unanswered: Search in BD

    I'm trying to make my first database with Brilliant Database and I have no problems for now with creating a forms, print reports etc. But, here is something I need to do but really don't know how.
    It's about the searching the records according to several criteria. All criteria are related to several columns in my table which are numeric fields. Roughly simplified this task can be described for two columns only:
    - user needs to select a fixed value for searching a col1 and
    - some kind of range for searching a col2, ie. fixed value and +/- tolerance.
    For example. User need to find and display all the records where is:
    - col1 =8 and
    - col2= 125 with tolerance +/- 7 % ( that means between the 116,25 and 133,75)
    Note that particular criteria should be skipped if user choose nothing.
    I really hope , someone more familiar with BD will show me how this code looks like and where to put it.
    I will add a "search" button to toolstrip for peforming this action.
    Sorry because of my bad English and thanks in advance.

  2. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hello.
    Welcome to dBForums.

    See attached file for a working example of what your after.

    Kind regards
    James
    Attached Files Attached Files

  3. #3
    Join Date
    Nov 2013
    Posts
    6
    Hi, Tubbritt,
    Thanks for your reply.
    I tried to run first or second query and I got a message: "No records were found." I saw your code in Database Scripts but I don't know how it is related to queries.
    Seems to me, I'm missing someting.
    Recently I was creating a similar database with data-searching, but in another language ( VB. net). See the screenshot. I'm wondering is it possible to create something similar in BDB, ie. a new form for entering a search parameters?
    If yes, how to do it?
    Attached Thumbnails Attached Thumbnails screenshot.png  

  4. #4
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hello.
    Your not supposed to run it that way.

    Press the search button I put in the top left.

    Regards
    James.

  5. #5
    Join Date
    Nov 2013
    Posts
    6
    Ok. Thanks.
    But, search is not working if I skip the first criteria.

  6. #6
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hello.

    In your original post the way I understood what you were saying is that the user may at times choose to skip your “col2” check, which is the second item.

    So that's the way I wrote this.

    Right now it works two ways. They can enter both values, your col1 and col2, or they can enter the col1 value on it's own and it will still work.

    If you also want it to work from entering the col2 value only, then simply look at how I made it skip the second value and apply that exact same logic to the first value.

    So you will me making a query almost identical to the one I've already made and you will update the "run search" button to reference the third query.

    Any problems let me know.

    Regards
    James

  7. #7
    Join Date
    Nov 2013
    Posts
    6
    Thanks for your explanation.
    I'll try, but let me know, is there a possibility to create a separate form for searching, as is mentioned above?

  8. #8
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Yeah sure.
    See attached file.

    Regards
    James
    Attached Files Attached Files

  9. #9
    Join Date
    Nov 2013
    Posts
    6
    Hi, James,
    Thank you for your kind help.
    I will ask for help again if I get stuck somewhere.

Posting Permissions

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