Link to home
Start Free TrialLog in
Avatar of Delores_C
Delores_CFlag for United States of America

asked on

Adding filename and path on a report in Access 2007

I have used the code below to insert the database table name in a report, but it is not working in Access 2007.  Can someone please tell me the new code to use.

=[CurrentDb].[Name]
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

=currentproject.FullName
Where are you putting this value?

Have you tried:  =Currentproject.fullname
Avatar of Delores_C

ASKER

text box, source code
I tried putting your code in the text, report footer.  It did not work
strange, works for me.

Try this.  Replace the textbox with a label (lbl_database).

Then in the report footers Format event, try this:

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

    Me.lbl_Database.Caption = CurrentProject.FullName
   
End Sub
Are you displaying your report in Preview or Report or Layout view?
Preview

Still getting an error.  See exactly what I have entered and the message received

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
    Me.lbl.Database.Caption = CurrentProject.FullName
End Sub

Error Message received “  A custom macro in this report has failed to run, and is preventing the report from rendering.”
 
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, it worked