Solved

passing parameters to docmd.openreport

Posted on 2004-10-19
1
381 Views
Last Modified: 2011-09-20
I have a report based on this query

SELECT TBL_Header.inputID, TBL_Header.Date, TBL_Header.Planner_ID, TBL_Header.Planner_Name, TBL_Header.Product, TBL_Header.Description, TBL_Header.Basic_UM, TBL_Replenishment.location AS locationRC, NZ([TotalCIP],0) AS TotalCIPRC, NZ([On_OrderRC],0) AS On_OrderRCN, NZ([OnHandRC],0) AS OnHandRCN
FROM TBL_Header INNER JOIN TBL_Replenishment ON TBL_Header.inputID = TBL_Replenishment.input_id;

The report works OK
I create a form to pass parameters to the report
this is the section where I Call it

If txReportname = "RPT_replenish2" Then
    txCode = Me.cbCode
    txDate = "*"
    txSBU = "*"
  Me.txtWarning = txReportname & " " & txCode & " " & txDate & " " & txSBU
  Me.txtWarning = "([Product]=""" & Me.cbCode & """ )"
  DoCmd.Beep
  DoCmd.OpenReport "rptBasic", acViewPreview, , Me.txtWarning = "([Product]=""" & Me.cbCode & """ )"
  TBL_Header.Product

but i get all the records in the query and at the end an error that says "Object required"
0
Comment
Question by:TOPIO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 39

Accepted Solution

by:
stevbe earned 500 total points
ID: 12349202
 DoCmd.OpenReport "rptBasic", acViewPreview, , "[Product]="'" & Me.cbCode & "'"

Steve
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question