Help displaying values instead of ID

Hi there guys.

I have a project with 4 tables

Customers
Vehicles
Make (vehicle makes)
Model (vehicle models)

Model table has a makeid linked to make table so when adding a model you link it to a make

When adding a vehicle I have a select field for make to lookup makes from make table and then ajax reload the model select field with and auto lookup of the model table with a where statement linked to the make field:
Where makeid = {make}

The vehicle is then linked to a customer with a customerid fk.

The problem is, when viewing the details. The lookup is showing the make id and the model id (numbers) instead of the values under make and model fields.

I would like to show the actual values, eg: Audi, A3, instead of 3,3 which are the respective ids

Any help is sincerely appreciated.

Sounds like you’re missing the field name in the lookup SQL. Take a look at this portion:

select taskid, taskname 
from tasks
where taskid <> {taskid} and projectid = {projectid}
order by taskname

From here.

thanks for the response. I just went through and deleted all data in the make and models tables and redid the lookups on the forms to add the name instead of id.

You need both and in the order specified in the example above. That way it uses the id internally but displays the name externally in the lookup.