Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Posts
    173

    Unanswered: Set a form's recordset / source to a parameter query

    I'm sure this is simple to do, but I have a parameter query that I want to pass the parameter to from code and then open a form with those results. I can't seem to get this to work. Any help appreciated. Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250
    Need more info. Where is the parameter coming from? User input? A control? Are you trying to open a single record? In this case, create a command button to open form with current record-- the wizard does the code for you.

  3. #3
    Join Date
    Apr 2004
    Posts
    173
    The information would be coming from an input box coded to validate the entry of the parameter. The returned set of records are loaded into a subform that is essentially for display use only.

  4. #4
    Join Date
    Apr 2004
    Posts
    173
    I had a go at this myself, but the only way I could find to make this work was to pour the results of the query into a temp table and make that the recordsource for my subform. Is there a better way to do this?

  5. #5
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    you can make a form based on your query and when opening the form use filter option instead of parameters.
    ghozy.

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    or consider my lazy way of doing it: replace the WHERE clause in the SQL of the saved query.

    see how here (it's DAO code - tho there is probably a way to ADOize it).

    izy
    currently using SS 2008R2

Posting Permissions

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