Changing Report Caption

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having problems with changing the caption of a report in code. The
return error message is "Type Mismatch". Below is a sample of my code:

DoCmd.OpenReport "SL_Rebate_Statement_List_Combined", acViewDesign
Reports!SL_Rebate_Statement_List_Combined.Caption = strReportName & " " &
QtrSel & " - " & Date
DoCmd.Save

The type mismatch appears on the Reports! line. This should work. Could it
be an issue with the libraries?

Someone please help!
 
How are we to know where strReportName and QtrSel are coming from and their
values? The code worked for me as long as I had defined the values.

Also, if you are attempting to save the report, you need to specify this in
your code:
DoCmd.Save acReport, "SL_Rebate_Statement_List_Combined"

I also don't like to combine data types without explicitly performing the
conversions:
....QtrSel & " - " & Format(Date,"mm/dd/yyyy")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top