Results 1 to 4 of 4
  1. #1
    glennib is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    3

    Simple Searchable Form

    Hello



    I have a slight problem regarding a form in Access 2007. I have a simple table with a few columns, and a query which takes the text from a form's textbox as a search criteria. If any of a row's fields contain the search-box' string, they are returned in the query. This query is used as the recordset in the same form.

    The problem is that even when I requery using a button, the form is not responding with the correct results. If I just open the query with the form with the search-box already being open, the correct results are returned. Instead I just receive the whole table, which is not filtered.

    The example-database is provided (2007).

    Could anyone please help me in solving this problem?

    What I want is that the form will update its results to the query whenever the search-button is pressed.

    Search-query (also the recordset of the form):
    Code:
    SELECT *FROM Kommuner
    WHERE Navn Like '*' & forms!Kommuner!txtSøk.Text & '*' Or Postnummer Like '*' & forms!Kommuner!txtSøk.Text & '*'
    ORDER BY ID;
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Haven't looked at the sample, but try dropping the ".Text" from your form references. The Text property requires focus, the default Value property does not.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    glennib is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    3
    That was the problem. Good to know, thank you!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. How to create a searchable database?
    By BobCarolgees in forum Access
    Replies: 3
    Last Post: 10-10-2012, 01:48 PM
  2. Help creating a simple form
    By mattmurdock in forum Forms
    Replies: 3
    Last Post: 06-18-2012, 11:27 AM
  3. Print report from searchable form
    By Fauzi in forum Access
    Replies: 1
    Last Post: 01-24-2012, 04:26 PM
  4. Simple Form Question
    By gl2295164 in forum Access
    Replies: 1
    Last Post: 07-31-2011, 09:16 PM
  5. Replies: 1
    Last Post: 08-14-2009, 03:53 AM

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