Database Name on Report

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I'm writing a linked table report to display linked
tables and their paths in the database. I'd like to
display the current database name in the header of the
report, ie. "Linked Tables for the ABCCompany.mdb". How
do I display the current database name on the report? I
tried a =currentDb() in the control source of a text box,
but that results in "name?".

Thanks,
Joe
 
I'm writing a linked table report to display linked
tables and their paths in the database. I'd like to
display the current database name in the header of the
report, ie. "Linked Tables for the ABCCompany.mdb". How
do I display the current database name on the report? I
tried a =currentDb() in the control source of a text box,
but that results in "name?".

You were close. Try:

Dir$(CurrentDb.Name)
 
In the Report Header or Page Header, I found that either Dir or CurrentDB
popped up a parameter InputBox asking for the value to be entered. But
creating a TextBox named txtDBName and putting in the Print event the
following code worked just fine:

Me!txtDBName = CurrentDB.Name

Larry Linson
Microsoft Access MVP
 
In the Report Header or Page Header, I found that either Dir or CurrentDB
popped up a parameter InputBox asking for the value to be entered. But
creating a TextBox named txtDBName and putting in the Print event the
following code worked just fine:

Me!txtDBName = CurrentDB.Name

Thanks, Larry. I can't recall ever running into that, but I do tend to use VBA
for this sort of thing.

:-)
 
Back
Top