How to display CurrentDB.Name in form caption?

G

GaryS

That pretty much distills it:

What is the syntax for displaying something like:

Plant Database Main Menu <filename>

where <filename> is the value of CurrentDB.Name ?

IOW, how would I code the string expression in the form's
property sheet Caption ?

Thanks.
 
A

Allen Browne

Use the Open event of the form to assign its Caption.

The code for the event procedure would be:

Private Sub Form_Open(Cancel As Integer)
Me.Caption = "Plant Database Main Menu - " & CurrentDb().Name
End Sub
 
G

GaryS

Thanks, Allen, it worked great!

Gary
-----Original Message-----
Use the Open event of the form to assign its Caption.

The code for the event procedure would be:

Private Sub Form_Open(Cancel As Integer)
Me.Caption = "Plant Database Main Menu - " & CurrentDb ().Name
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.





.
 

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