Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Adding filename and path on a report in Access 2007

Posted on 2011-10-10
9
Medium Priority
?
244 Views
Last Modified: 2012-05-12
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]
0
Comment
Question by:Delores_C
  • 4
  • 3
  • 2
9 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 36943553
=currentproject.FullName
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 36943571
Where are you putting this value?

Have you tried:  =Currentproject.fullname
0
 

Author Comment

by:Delores_C
ID: 36943603
text box, source code
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Delores_C
ID: 36943625
I tried putting your code in the text, report footer.  It did not work
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 36943685
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
0
 
LVL 77

Expert Comment

by:peter57r
ID: 36943686
Are you displaying your report in Preview or Report or Layout view?
0
 

Author Comment

by:Delores_C
ID: 36943804
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.”
 
0
 
LVL 49

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 36943811
You need to change the name of the label to: lbl_Database

Then change you one line of code to:

    Me.lbl_Database.Caption = CurrentProject.FullName
0
 

Author Comment

by:Delores_C
ID: 36943918
Thanks, it worked
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question