Solved

passing parameters to docmd.openreport

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

759 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

24 Experts available now in Live!

Get 1:1 Help Now