I have a database project that I created with several forms and
reports. I would like to be able to declare a single title and be
able to change the title on all the forms and reports by changing a
single variable. I think this is possible, however I don't know
Visual Basic very well. I created a module named DBcommon with the
following statements in it:

Derek, you could use the Open event of every form and report to:
Me.Caption = DBName

However, this doesn't seem like a very useful idea. The form/report caption
would be better providing the user with information about where in the
program they currently are (a unique name), and would also allow the user to
select from on of several open forms/reports on the Window menu.

I have a database project that I created with several forms and reports. I would like to be able to declare a single title and be able to change the title on all the forms and reports by changing a single variable. I think this is possible, however I don't know Visual Basic very well. I created a module named DBcommon with the following statements in it:

Thanks for your quick reply. I guess I didn't phrase my situation
very well. I am trying to change the Company Name on the report,
which I mis-identified as the Title of the report. I found a way to
make it work, but was curious what was considered best practices. I
put the Company name in a text box and created a module with a public
function returning the string Company name. The code looks like this.

Public Function CompanyName() As String
On Error Resume Next
CompanyName = "Company1, LLC"
End Function

Is there a better way to achieve this result? Something that would be
considered best practices?

Derek, you could use the Open event of every form and report to: Me.Caption = DBName

However, this doesn't seem like a very useful idea. The form/report caption would be better providing the user with information about where in the program they currently are (a unique name), and would also allow the user to select from on of several open forms/reports on the Window menu.

I have a database project that I created with several forms and reports. I would like to be able to declare a single title and be able to change the title on all the forms and reports by changing a single variable. I think this is possible, however I don't know Visual Basic very well. I created a module named DBcommon with the following statements in it:

Thanks for your quick reply. I guess I didn't phrase my situation
very well. I am trying to change the Company Name on the report,
which I mis-identified as the Title of the report. I found a way to
make it work, but was curious what was considered best practices. I
put the Company name in a text box and created a module with a public
function returning the string Company name. The code looks like this.

Public Function CompanyName() As String
On Error Resume Next
CompanyName = "Company1, LLC"
End Function

Is there a better way to achieve this result? Something that would be
considered best practices?

Derek, you could use the Open event of every form and report to: Me.Caption = DBName

However, this doesn't seem like a very useful idea. The form/report caption would be better providing the user with information about where in the program they currently are (a unique name), and would also allow the user to select from on of several open forms/reports on the Window menu.

I have a database project that I created with several forms and reports. I would like to be able to declare a single title and be able to change the title on all the forms and reports by changing a single variable. I think this is possible, however I don't know Visual Basic very well. I created a module named DBcommon with the following statements in it:

There are usually a number of these entries: Company name, address, phone
number, fax, web, email, and various other user preferences you need to
store. A simple solution is to create a system table to hold the values:
- a field to hold the variable name (e.g. "CompanyName"),
- a field to hold the value (e.g. "Company1, LLC")
If you allow the user to change entries, you may also want:
- a field to hold a description (so the user knows what they are changing).
- a boolean field for system values that can't be deleted or renamed
(IsSystem)
- a boolean field for hidden entries (IsHidden) filtered by a query
- a field that defines the kind of data appropriate to this field (tested
with IsNumeric(), IsDate() etc before an entry is accepted).

Thanks for your quick reply. I guess I didn't phrase my situation very well. I am trying to change the Company Name on the report, which I mis-identified as the Title of the report. I found a way to make it work, but was curious what was considered best practices. I put the Company name in a text box and created a module with a public function returning the string Company name. The code looks like this.

Public Function CompanyName() As String On Error Resume Next CompanyName = "Company1, LLC" End Function

Is there a better way to achieve this result? Something that would be considered best practices?

Derek, you could use the Open event of every form and report to: Me.Caption = DBName

However, this doesn't seem like a very useful idea. The form/report
caption would be better providing the user with information about where in the program they currently are (a unique name), and would also allow the
user to select from on of several open forms/reports on the Window menu.

I have a database project that I created with several forms and reports. I would like to be able to declare a single title and be able to change the title on all the forms and reports by changing a single variable. I think this is possible, however I don't know Visual Basic very well. I created a module named DBcommon with the following statements in it: