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

File name and path on Report Footer 1

Status
Not open for further replies.

RobertGardiner

Technical User
Feb 13, 2003
6
AU
I want to put the File name and path into a report footer, in Excel =Cell("Filename") will cause it to display the full path and the File name.

I want to do this in an Access Report ???
 
Create a module an paste the following;

Function DbName() As String
Set db = DbEngine(0)(0)
DbName = db.Name
Set db = Nothing
End Function


Then set the control source of your report textbox to "=DbName()" Open your report and you should have the results you desire.
Note: You can use this sontrol source any where you like in your database

Good Luck

Rob
 
It came back with variable not defined it was refering to "db"

Does the fact I'm using Access97 have an impact?
 
Probably
Try this

Function DbName() As String
Dim db as database
Set db = DbEngine(0)(0)
DbName = db.Name
Set db = Nothing
End Function
 
Thanks that works realy cool

I often wonder why valuable features are missing from access, things like rounding numbers random number generator and the file name path.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top