Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    23

    Unanswered: Show entries that matches fields in MS Access form

    Hi,

    I have 2 fields and a button in MS access 2007 form. When the fields are entered and button is pressed, the entries should be retrieved from table Test_Data and shown in data sheet view. For this i have written a macro which opens a query and displays the table entries. But the query displays all the records present in the table. I want only the entries which matches the fields that are entered in the form. I think i have to use the where clause in sql query but i dont how to do that. Can any one help me regarding this. Thanks.

    Please find the attached db file.
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2004
    Posts
    214

    ...

    Generally if you want query results to be based off of criteria on your form you use the following in the criteria of your query

    [Forms]![[Your Form Name]![Your Field Name]

    So if your form is called Data Entry and your field in question is Combo1 then the it would look like this
    [Forms]![Data Enrty]![Combo1]

    Good luck!
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  3. #3
    Join Date
    Jun 2009
    Posts
    23

    Re: SOLVED - Show entries that matches fields in MS Access form

    Thanks a lot. It worked for me.

Posting Permissions

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