Search code examples
formsms-accesslistbox

Access show fields based on value


I'm trying to make a form with Access.

If the value in 'Activiteiten' is 'Onderzoek' I want the field 'Penvoerder' and 'Subsidie' to appear. And if the value 'Activiteiten' is something else I want different values to appear.

Does anyone know how to solve this?

I've tried multiple settings in the properties of the fields. But this didn't work.


Solution

  • Use the OnCurrent event:

    Dim Visible As Boolean
    
    Visible = (Me!Activiteiten.Value = "Onderzoek")
    Me!Penvoerder.Visible = Visible