CodeCharge Studio

Modify a Label Field on the Task Maintenance Page

Now let's make one necessary modification on the Task Maintenance page where you might have noticed that the Label field "Assigned By" doesn't display the employee name, but the user id, as shown below. This is because tasks table contains only the user id, while employees table contains the user's name, just like "Assigned To" ListBox displays employee names from another table.

There are several potential methods of dealing with the above issue and let's explain each one in detail:

  1. Create a Query that contains multiple tables and can be used as the data source for the record form.
    Unfortunately, queries that contain multiple tables may not be updateable by their nature, and thus your whole record form may stop working. In other words, if you specified that you want to use a query containing tasks and employees table in your record form, then if you assigned a task to someone else, the program wouldn't know if you wanted to update the tasks table with the new employee_id, or if you wanted to update the employees table and change employee's name.

    Thus if you used multiple tables as a data source for the record form, you would also need to specify Custom Insert, Custom Update and Custom Delete operations in record form's properties, to specify which database fields should be updated with corresponding values entered on the page.

    This approach looks like too much effort just for displaying one additional value on the page.

  2. Use an Event Procedure to insert custom code where you can programmatically output the desired value. This method is very flexible, as it allows you to extend the generated code by adding your own. The next step describes this method in detail.

Next: Use the Before Show Event to Alter a Label's Value


On-line, printable versions and updates