Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

passing parameters to docmd.openreport

Posted on 2004-10-19
1
Medium Priority
?
393 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 2000 total points
ID: 12349202
 DoCmd.OpenReport "rptBasic", acViewPreview, , "[Product]="'" & Me.cbCode & "'"

Steve
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

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