Newbie error for data vidualization. Advice

Good afternoon.
This may happen thousands of times to newbies, and I’m one more.
I’ve a Table (DRAWINGS) with ID_DRAWING; NAME and TYPE (fk to ID_TYPE) to Table (TYPE) witch also have NAME.

Then I make a Form with the fields to feed the (DRAWINGS) table:
ID_DRAWING, read only textbox
NAME, to write a name, textbox
TYPE, Listbox to get the Name (dwg; dxf; step) from (TYPE) table, “for consistency”! (SQL to see the TYPE instead of ID numbers).

Now I put a Table control in the Form to see the Records that I’m inserting into (DRAWINGS) table, and to select a record to edit, if necessary.
Of course, the TYPE in that Table control appears as 0, 1 or 2, instead of (dwg; dxf; step).
How do you approach this “simple” problem, to see the actual (dwg; dxf; step) instead of ID’s?
Thank you in advance!

  1. Create a query like SELECT "Name", "ID" FROM "Types" ORDER BY "Name" ASC. Name it something like “Listbox_Types”.
  2. While in form design mode, right-click the column with the numbers and choose Replace With>List Box
  3. On the “Data” tab of the column properties:
    3.1. Linked field= same as before, the foreign key column pointing to the right type by number.
    3.2. Source type=Query
    3.3. Source=Listbox_Types
    3.4. Input required=Yes (in most cases, you want yes)
    3.5 Bound field = 1 (which refers to the second field, the first one would be 0)

Now you can select (or enter by keyboard) the right item ID by its corresponding name.

The amount of time, trying to use so many things, without results.
It can looks just like a textbox, but configurable to show what we want!!
Thank you so much!

The Base Guide
Base tutorials
Database Examples

1 Like