Solved

passing parameters to docmd.openreport

Posted on 2004-10-19
1
372 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

730 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