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

Rename report in access vba

Status
Not open for further replies.

cdlaforc

Programmer
Oct 11, 2006
6
US
Hello,
Can someone tell me how to rename a report in access with vba.
Thanks,

Chris.
 
like this?

Code:
    Reports("OldName").Name = "New Name"

Hope it helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
When I do this I get the error that the report name is misspelled, doesn't exist, or isn't open. I copied the name of the report so I don't know why I'm getting this.
Thanks,

Chris.
 
How are ya cdlaforc . . .

Have a look at the [blue]DoCmd.ReName[/blue] method! . . .

Calvin.gif
See Ya! . . . . . .
 
Thanks everyone I actually got it to work a little differently. What I was doing is querying a table with records for a bunch of different departments at work so I was looping through the departments and I wanted to rename the report and then print it to my adobe writer and name it back, then do it again. A guy at work just suggested to write it out and then use the Name method to rename the file at that point. It worked fine, but again thanks for the help.
Thanks,


Chris.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top