Solved

passing parameters to docmd.openreport

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now