Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two Prompts Macro Problem

Status
Not open for further replies.

1hrllabs

Technical User
Feb 21, 2005
19
US
I've written the following macro (I've only included a small section) and am having a problem with the second prompt, Year Selector. The macro works fine with a single prompt, the Month Selector. But when I modified the Report to include Year as a prompt, that's when the problem began. How do I get the macro to work. It stops and is waiting for the OK button to be hit.
Thanks,
Joe
Sub Main()
Dim x
Dim msgtext
msgtext="Enter a month number (1-12):"
x = InputBox$(msgtext, "Month Selector",1)
Dim y
Dim msgtexts
msgtexts="Enter Year (ex. 2006):"
y = InputBox$(msgtexts, "Year Selector",2006)



Dim objImpApp As object
Dim objImpRep As Object
Set objImpApp = GetObject("CognosImpromptu.Application")
objImpApp.Visible True
objImpApp.OpenCatalog _
"s:\imp71_reporting_tools\BI04\Imp71_User\CATALOGS\Costpoint Catalogs\General Ledger.cat","Plan","hire1cop",,,1
rem ***This is the beginning of the macro. Reports are generated first for the Green Book. Then for the Lab directors.***

Set objImpRep = _
objImpApp.OpenReport("s:\imp71_reporting_tools\joe's reports\Foss\" & _
"Report_01.imr",+x,+y)
objImpRep.RetrieveAll
objImpRep.Print
objImpRep.CloseReport
 
Dude,
you need a pipe to pass more than one prompt to the impromptu report - otherwise it's seen as just one prompt.
substitute +x+"|"+y for +x,+y in your openReport line
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top