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

Access Report - Passing parameters 1

Status
Not open for further replies.

CmPaiva

Programmer
Nov 13, 2002
124
0
0
PT
Hi,
Does anybody knows how to pass a parameter to an Access Report, not for filtering (DoCmd parameters do this), but just to be shown in the report (Say StationId: ...), and that is not related with report data.
In Crystal reports, i'd used to pass this by using Formulas, but I can't find a way of doing this in Microsoft Access Report!

Thanks in advance, for your help
Carlos
 
Hi, Again!

I manage to find the answer. I do not know if is the best way, but I do as:

- Open the report in design mode
- Change Labels captions as desired
- Then open report again for print.

Code is as follows:

With mAccessApp
.OpenCurrentDatabase App.Path + "\cpRegistry.mdb"
.RunCommand acCmdWindowHide
.RunCommand acCmdAppMinimize
' .Visible = True
.DoCmd.OpenReport "Results", acViewDesign
With .Reports("Results")
.Controls("Title").Caption = "Results By " + mResult
.Controls("Description").Caption = mDescription
.Application.DoCmd.OpenReport "Results"
End With
End With

Thanks anyway
Carlos Paiva
 

Yep, that's how to do it.

Thanks for posting your solution for others to see!
 
Hi, CClint,

I think that it is the right way to put this forum to work!

Thanks for your comment,

Carlos Paiva
 
A Star for CmPaiva - may many others learn from your good example!


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top