By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,807 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,807 IT Pros & Developers. It's quick & easy.

Naming reports created programatically

P: 9
Hi all

I'm creating a number of reports programatically, and I'd like to be able to name them sensibly. However, when I try something like
Expand|Select|Wrap|Line Numbers
  1.  rptNew.Name = "something sensible"
I just get told that "this property is read-only and can't be set".

Am I trying to do something you can't do? Or am I just doing it wrong?

Thanks in advance

Peter.
May 29 '08 #1
Share this Question
Share on Google+
2 Replies


puppydogbuddy
Expert 100+
P: 1,923
Hi all

I'm creating a number of reports programatically, and I'd like to be able to name them sensibly. However, when I try something like
Expand|Select|Wrap|Line Numbers
  1.  rptNew.Name = "something sensible"
I just get told that "this property is read-only and can't be set".

Am I trying to do something you can't do? Or am I just doing it wrong?

Thanks in advance

Peter.
Peter,
If the report exists, you can call the Rename() method of the DoCmd object. The syntax to use is:

DoCmd.Rename(NewName, acReport, OldName)

Remember that your report can't be open at the time you rename it, or you will get an error.
May 29 '08 #2

P: 9
puppydogbuddy

That's really helpful, thank you!
May 29 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.