Color scheme: Dark
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » Data views » WklPropertyGrid » Show the selected customer as a property list

Show the selected customer as a property list

Build a form with a customer list on the left and the selected customer on the right as a property list that's edited in place and saved field by field.

Prerequisites

  • Microsoft 365 Access or the Access Runtime, 32-bit or 64-bit, with the WKL Forms Object Library 1.38 or later installed and registered for the current Windows user (How to: Install the released package).
  • A table tblCustomer with the fields ID (Number, primary key), Name and City (Short Text), Active (Yes/No), and Since (Date/Time), plus a few records.
  • Every WKL control opens its designer the same way: in Design view, open the property sheet (F4), go to the Other tab, and click [...] in the Custom row (Opening the designer).

Steps

1. Insert the list and the property grid

Create a form named frmCustomers in Design view. Choose Form Design › Controls › ActiveX Controls, insert WKL Grid, and name it Grid1. Then insert WKL Property Grid to its right and name it Props1.

2. Bind the list

Select Grid1 and click [...] in the Custom row of the property sheet. On the Record source page, set the record source to tblCustomer and the key field to ID. On the Columns page, add Name and City. Click OK.

Select Props1 and open its designer ([...] in the Custom row):

  1. Record source page: record source tblCustomer, key field ID.
  2. Link page: master Grid1, child field ID.
  3. Rows page: add Name and City; then add Active and Since, and type Status as their Category. Give Since the caption Customer since.

The preview shows the lines: Name and City at the top, and the Status category with its two fields below. Click OK and save the form.

4. Work with the form

Open frmCustomers in Form view and click a customer in the list: the property grid shows that customer. Click City, type a new city, and press Enter; the value is written to tblCustomer when you leave the line. Click the Status header to collapse the category. Up and Down move from line to line, and Tab moves from value to value.

Expected result

The property grid follows the list, shows the customer's fields in two groups, and saves each changed field immediately. Until a customer is selected in the list, the property grid stays empty.

Next steps

en/wiki/msaccess/comctl/data-views/propertygrid/tutorial.txt · Last modified: by Wolfgang van der Stille