Change the capiton of the Report

  • Thread starter Thread starter ToryBennyBassiKova
  • Start date Start date
T

ToryBennyBassiKova

I am printing to pdf files


For i = 1 To Liste4.ListCount - 1
DoCmd.OpenReport stDocName, acViewNormal, , "MXId=" & Liste4.Column(2, i)
Docmd.SelectObject acReport, stDocName
Docmd.RunCommand acCmdPrint
Docmd.Close acReport, stDocName, acSaveNo
Next i

I want to give each report a unic name as i e: Prefix & Liste4.Column(2, i)

How can I change the stDocName, so it is easy to save?
 
ToryBennyBassiKova,
Use the OpenArgs argument of the OpenReport method.

DoCmd.OpenReport stDocName, acViewNormal, , "MXId=" & Liste4.Column(2, i), ,
"XXYXX"

On the report... = [OpenArgs] would display as XXYXX.
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Back
Top