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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass a variable to Enter Parameter Value box

Status
Not open for further replies.

vangundy

Programmer
Jan 29, 2005
38
CA
With my code below I am exporting a report to snp format onto my c: drive. ONLY problem is I keep getting the Enter Parameter Value box. How can I pass a variable (varName) to this parameter and then export the report to snp. Again the export works fine but I keep getting the Enter Parameter box. I want to bypass this box with a value contained within my variable.

Dim Axs As Access.Application
Set Axs = CreateObject("Access.Application")

varName = "smith"

Axs.Visible = False
Axs.RunCommand acCmdAppMaximize
Axs.OpenCurrentDatabase ("c:\Report.mdb")
Axs.DoCmd.OutputTo acOutputReport, "Report1", acFormatSNP, _
CurrentProject.Path & "\Test.snp"

 
What exactly the parameter box asks?
Are you getting the report filtered with the varName? Or the report brings all the records?
Is the report's recordsource is a query?
If it is a query then, does the query needs any criteria to be given before it run?
One more thing... You didn't declare varName
Please comeback

Zameer Abdulla
JVBP MDS
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
Yes its the query that contains the parameter. The query within Access. The query is connected to the report so when you run the report you are prompted to enter a parameter which is normal..
 
You didn't reply all of my questions...
any way..
Convert the query into SQL and paste it into the module where you can use the parameter. Also connect the SQL to the report.

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top