Database Name on Report

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
 
B

Bruce M. Thompson

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)
 
L

Larry Linson

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
 
B

Bruce M. Thompson

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.

:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top