Hi
I have a saved report with a saved qry as the datasource with a [select ID] parameter on the ID field in the qry. I have VBA code that prompts for the ID and exports the SNP report to a folder. I do not want to open and read the report, I just want to generate and save it. However, I want to capture the [select ID] value and append it to the exported filename, but I can't figure out how. for example, the report name to save is "rpt_MyReport.snp". The [select ID] value entered is "52", I'd like the saved SNP name to be "rpt_MyReport_52.snp". Can anyone help me figure out how to do this? Below is the part of my code that might help show what I'm trying to do.
stDocName = "rpt_MyReport"
stSNPsaveName = CurrentProject.Path & "\rpt_MyReport_"
Dim SaveASstr As String
SaveASstr = stSNPsaveName '& Append the [select id] value here
DoCmd.OutputTo acOutputReport, stDocName, acFormatSNP, SaveASstr, True
Thanks
I have a saved report with a saved qry as the datasource with a [select ID] parameter on the ID field in the qry. I have VBA code that prompts for the ID and exports the SNP report to a folder. I do not want to open and read the report, I just want to generate and save it. However, I want to capture the [select ID] value and append it to the exported filename, but I can't figure out how. for example, the report name to save is "rpt_MyReport.snp". The [select ID] value entered is "52", I'd like the saved SNP name to be "rpt_MyReport_52.snp". Can anyone help me figure out how to do this? Below is the part of my code that might help show what I'm trying to do.
stDocName = "rpt_MyReport"
stSNPsaveName = CurrentProject.Path & "\rpt_MyReport_"
Dim SaveASstr As String
SaveASstr = stSNPsaveName '& Append the [select id] value here
DoCmd.OutputTo acOutputReport, stDocName, acFormatSNP, SaveASstr, True
Thanks