Auto Title in a Form

Chief

Registered User.
Local time
Today, 02:14
Joined
Feb 22, 2012
Messages
156
Access 2010
Hello,
I have several forms where I have the title being populated with the First Name and the Last Name. Then I want the Company to populate after their name.
The company is a combo box on the form which is populated from a table with a relationship to the company. In this case ClientID.
So i can get the ID Number to appear in the Title with the name, but I am unsure as to how to get the actual name to appear.
Please see Screen Shots attached for information.

Thank you
Regards
Jason
 

Attachments

  • AutoTitle01.jpg
    AutoTitle01.jpg
    84 KB · Views: 581
  • AutoTitle02.jpg
    AutoTitle02.jpg
    80.9 KB · Views: 426
The Record Source Property of the Company Name Text Box Control could be DLookup()

Check your help for DLookup, it is quite a handy function.

Alternatively, your Data Source could be an SQL which collects all the data required for the form rather then use one table and then need to bring in additional data.

You can also use Events to Re Query or Refresh your form should the operator select a different CompanyID.
This code could be in the After Update Event of the control used to select the Company ID.

If you have difficulty with DLookup, re post and I will find an explanation for you.
 
This may help - from my ms access help.

You can also use the DLookup function in an expression in a calculated control on a form or report if the field that you need to display isn't in the record source on which your form or report is based. For example, suppose you have an Order Details form based on an Order Details table with a text box called ProductID that displays the ProductID field. To look up ProductName from a Products table based on the value in the text box, you could create another text box and set its ControlSource property to the following expression:
VBA =DLookup("[ProductName]", "Products", "[ProductID] =" _ & Forms![Order Details]!ProductID)
 

Users who are viewing this thread

Back
Top Bottom