Application title in form caption ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to put my application title (as defined in Tools-Startup) in the
caption of all my forms. How do I do this? I tried using the application
object but there is no title property.
 
while in design mode, right click the small square in the
upper left corner of the form then click properties. enter
any text you wish into the caption property.
 
I need to set it to the application title via VBA.
The whole point of this is so I have to change the title only ONCE and not
have to change the caption in every form.
 
Store the Title in a table, Then do a DLookup in the caption property of
each form or report.

Jim Evans
 
There are lots of ways to do this, here is just one.

1. Create a new standard module and copy/paste this code:

Public Function funcAppTitle() As String
Dim db As DAO.Database
Set db = CurrentDb()

funcAppTitle = db.Properties("AppTitle")

Set db = Nothing
End Function

2. Set a reference to the DAO object library if you do not have one already.

3. Compile the code, close, and save the module as modAppTitle.

4. In every form's Open event, put this code in:

Private Sub Form_Open(Cancel As Integer)
Me.Form.Caption = funcAppTitle
End Sub

That should do it.
 
Back
Top