How to Change a Form Title or Caption

How to Change a Form Caption/Name

When MS Access form is opened the caption or title of form will be the same as a form name that shows in the Navigation pane. Sometime many developers name their Access forms like “frmMain, frm_User, or CustomerEdit.” For an example below, I name my main form as “Main Form.” When this main form is loaded the caption or title of this form will display as “Main Form” on the top left hand corner. If we want the form title to change to something else we can do that as well.

For this how to, I will show how to change a form title to a message “Welcome [user name] to my Database.” The [user name] will change to the name of the user who logged in to this program when a Main Form is loaded. The steps below will show you how to do it.

main form

Step #1 Create a User Table: In this how to, a Login Form will be loaded when program is opened and user will login to the program. Therefore, a user table must be created and assign a “LoginID or UserLogin and Password” for each user. Definitely, a name of each user is needed for this user table.

user table

 Step #2 Create a Login Form: this form is asking users to enter their Login ID or UserLogin and Password. If both Login ID and Password are correct then it will open a Main Form. I will not explain how to create a Login Form in this how to. How to Create a Login Form here.

  login form

Step #3 Create Main Form: Create a form and name it as “Main Form.” After user logged in successfully then program will open a Main Form.

on load main form

Step #4 Create VBA code: under the Main Form, we will add the VBA code to the On Load Event Procedure. When the Main Form is loaded it will be looking for a name of a user that logged in then change a form caption/title to “Welcome [Name] to my Database.” See picture below.

on load main formwelcome code

Note: TempVars!TempLogin is a temporary stored user login from a Login Form.

set UserLogin

For this how to, a user logged in as “jvang” and a correct password. The program will close a Login Form and then open a Main Form. Now the caption or title of Main Form is changed to “Welcome John Vang to my Database.” John Vang is a full name of “jvang” per the user table above.

login form

form caption changed


The accompanying archives viagra genérico 25mg required for 80g enlistment. viagra without prescription What Miracles Do The Herbs Perform? It is indeed hard to explain the individual roles of all the herbs used in the medicinal mixture, but together they achieve unbelievable healing power. This is where Kamagra tablets helps a lot and is now used as a common http://downtownsault.org/wp-content/uploads/2018/02/01-10-18-DDA-MINUTES.pdf cialis without prescription cure for many different issues mainly arthritis, back pains, neck and shoulder pains and so forth. Doctors suggest people suffering from erectile dysfunction to have browse content cialis soft order for their problem.

Related posts