Results 1 to 6 of 6
  1. #1
    shirvo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2011
    Posts
    3

    open report after search


    I have a database that you search for an invoice, I have made a report that opens up an invoice by putting in the id for the data entry and calculates all the prices and so on. I need to have a button on the search form that will open the report with the selected invoice data with out asking what the ID is.

  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
    How about this technique?

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    shirvo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2011
    Posts
    3

    nope

    That would print it and didn't open the report at all. HELP please

  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
    Look at OpenReport in VBA help and check out the available options for each argument.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    shirvo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2011
    Posts
    3
    I will explain it all with detail.

    I have a form called "search invoices" it is a datagrid form with a search box.

    Once the invoice is found and is selected I have a button that I need to have open a report.

    The report I have is made with a query that asks what the id is. So the report only shows one invoice at a time to what ever the id was.

    At the moment when I open the report it askd "What id?" and I put it in.

    when i used "DoCmd.OpenReport "select invoice", acViewPreview, , "ID = " & ID"
    it opens the report but still asks me for the id.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Generally you would use the wherecondition argument of OpenReport or a criteria in the query, not both. If you already have the query restricting the results to the appropriate record, you don't need the wherecondition. Try

    DoCmd.OpenReport "select invoice", acViewPreview
    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. access search open new form
    By jellybeannn in forum Access
    Replies: 1
    Last Post: 08-05-2010, 05:18 AM
  2. Replies: 0
    Last Post: 05-07-2010, 04:53 AM
  3. Replies: 3
    Last Post: 01-14-2010, 08:32 AM
  4. search,view and open function
    By blurboy84 in forum Reports
    Replies: 0
    Last Post: 10-08-2009, 11:42 PM
  5. Replies: 0
    Last Post: 10-16-2008, 02:39 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