Results 1 to 6 of 6
  1. #1
    P5C768 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95

    Display Query Results on a Form

    I have a query that finds birthdays in the current or upcoming month. I would just like to display the results of the query on a form, I was thinking in a textbox, and have the textbox refresh the query everytime the form is opened.



    The only piece I am having trouble with is linking the textbox to the query. I tried just setting the control source to the query, but I get a ?Name? error. Any ideas?

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Have you set the "Record Source" of the form to the query?

    Cheers,

  3. #3
    P5C768 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95
    I tried that as well, with no luck. Any other ideas? The filter and sort don't seem to do the trick either.

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    First run the query to make sure it is returning the proper dataset. Then use the Form Wizard (or do it manually if you know how) to create a form based on the query. Then in the form's Properties Box, In the On Open Event, open up the VBA window and type:
    Me.Requery
    Me.Refresh

    Save everything and it SHOULD work.

  5. #5
    P5C768 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95
    The only problem is I don't want a form based on query because I want to be able to display all the results from the query at once, rather than cycling through records.

    Maybe a subform in datasheet view is a better option? The query is working as is the code to refresh upon opening the form, I just need a good method to display all results at once.

  6. #6
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    In the Form Wizard, when it lets you choose what kind of form, choose Datasheet.

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

Similar Threads

  1. Open form based on query results
    By RobbertH in forum Queries
    Replies: 1
    Last Post: 02-10-2010, 08:13 AM
  2. Replies: 0
    Last Post: 11-10-2009, 12:06 PM
  3. display query results in a form
    By P5C768 in forum Queries
    Replies: 3
    Last Post: 08-14-2009, 03:02 PM
  4. Form to display results
    By Zholt in forum Forms
    Replies: 9
    Last Post: 05-07-2009, 10:09 AM
  5. Entering query results in a form
    By marcello.dolcini in forum Forms
    Replies: 0
    Last Post: 04-15-2007, 06:01 PM

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