Ask Experts Questions for FREE Help !
Ask
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #1

    Feb 2, 2008, 10:43 AM
    Search in access
    Hi !
    I creat a search query in ms access and when I want to find a special record in database ,
    The result is exactly the same input text that I enter the query. For example I want to find a name such as "abc", when a enter abc in query , the result show all records that their filed's name are "abc" but doesn't show the records that their fileds name is "abcd" or "abcde"...
    Is there any on to help me?
    MaggieMouse's Avatar
    MaggieMouse Posts: 226, Reputation: 8
    Full Member
     
    #2

    Feb 4, 2008, 07:52 AM
    Try to key in abc*, which means anything starts with abc.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #3

    Feb 4, 2008, 07:57 AM
    It depends on how you have created the search. If you are using a query, tyhen you have to use the LIKE operator:

    LIKE "abc*"

    Otherwise you will get only those that match abc*. You might want to check out the Filter by Form feature.
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #4

    Mar 4, 2008, 11:51 AM
    Thanks,but I have still problem whit this.
    In my project there is a text box that we must enter the name, in the text box for search.
    For example when I enter "john" in the text box the result doesn't show "johnson" or like this, or when I enter "manchester" in the text box it doesn't show "manchester city" or "manchester united".
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #5

    Mar 4, 2008, 11:55 AM
    Like I said it depends on how you are doing the search. If you are setting criteria as I said using Like and an * it will work. For me to help further you need to describe what you are doing.
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #6

    Mar 4, 2008, 12:03 PM
    I try to use this , but ms access show an error.
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #7

    Mar 4, 2008, 12:13 PM
    In my query in front of criteria is : [forms]![search_form]![txt_firstname]
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #8

    Mar 4, 2008, 12:28 PM
    That's not gong to work like I said. That will only find an exact match you need to use:

    Like [forms]![search_form]![txt_firstname] & "*"
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #9

    Mar 5, 2008, 10:23 AM
    Thank you very very much scottgem.
    That's OK, it solve my problem.
    I have another question too.
    As you know , if there is no result for the search, however query will be open.
    Is there any way to show a message if there is no result for the search.
    (without opening query).
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #10

    Mar 5, 2008, 11:52 AM
    Again, this depends on your code and how you are triggering the query. If you are running the query from VBA with a DoCmd.OpenQuery method, then you can use a DCount() function to check whehter the query returns any records and display a message if it doesn't.
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #11

    Mar 5, 2008, 12:14 PM
    In my project there is a macro that it's action is : open query
    DoCmd.RunMacro
    Can you describe about DCount() function ?
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #12

    Mar 5, 2008, 12:29 PM
    Look it up in Access Help. I also recommend getting away from macros. You can't do what you want with macros since you can't run a conditional like that.
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #13

    Mar 6, 2008, 09:51 AM
    Whit use this code it solve :
    If DCount("first_name]","[query_search_firstname]") = 0 Then
    msg=msgbox("Not Found")


    We can navigate between record's , in a form by using middle bottom of mouse,
    Can we disable it ?
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #14

    Mar 6, 2008, 11:48 AM
    Yep that looks like it would work.

    There is a utililty that can disable the wheel in Access forms. I can't find it right now, but if you search on Access Disable mousewheel you should find it.
    znet2705zc's Avatar
    znet2705zc Posts: 34, Reputation: 1
    Junior Member
     
    #15

    Mar 9, 2008, 11:30 AM
    I found a way to disable mousewheel ( in form access) in this site:

    VBA Express : Access - Disabling Mouse Scroll wheel from advancing database entries

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Name search [ 2 Answers ]

How do I no if a name for a business is already being used

Album search [ 1 Answers ]

Who sing this song with lyrics " you must not know about me i can have neither you in minute or if i killed him in minute baby " as starting words give me album name and from where can I download this song free

Can't access pop3, Pop3 access not working from my computer [ 1 Answers ]

I have XP SP 2 - Its been about a week since any of my pop3 accounts have worked (Gawab, Gmail, Spymac, Toughguy). The error messages I am receiving on all of my pop3 accounts are similar to : The host 'pop.gawab.com' could not be found. Please verify that you have entered the server name...


View more questions Search