Limiting the values in a dropdown based on an...

(Pim Sauter) #1

Limiting the values in a dropdown based on an earlier field

I have an app that contains a field that determines a type, let’s say bike/car. The next field is a dropdown, where you can choose from vehicles (this table contains both bikes and cars). Is it possible to limit the possible choices of this dropdown, based on the type? If I choose ‘cars’, I only get cars in the dropdown, and vice versa.

(Aleksi Alkio) #2

You are looking for a dependent dropdown. In the first field use a TableName[TYPE] and then in Vehicle field use TableName[VEHICLE] in Valid_If. If all your records contains the type, it will work.

(Pim Sauter) #3

Hey @Aleksi_Alkio, thanks for your answer.

What I forgot to tell, is that the second dropdown is a ‘ref’ field, so your solution unfortunately does not work. What I tried is valid_if, but this does show the values in the dropdown, and only flags them as invalid when entered

(Aleksi Alkio) #4

Uups :slight_smile:

SELECT(TableName[VEHICLE],[TYPE]=[_THISROW].[VEHICLE])