Home > Net >  MS Access using ApplyFilter from Macro Builder with combobox shows input parameter box
MS Access using ApplyFilter from Macro Builder with combobox shows input parameter box

Time:10-07

This time I'm trying to work on an MS Access application. I have a split form populated using a SQL query. Now I want to filter this form using a combobox which is located in the header of the form. This CB is also populated with a SQL query:

SELECT DISTINCT [ConsultQ].[ClientName] FROM ConsultQ; 

I have added an embedded query to this Combobox which should filter the form. The values shown in the Combobox are correct. But when I select a value from the box a popup show which asks me for input.

enter image description here

The ApplyFilter action is set to:

enter image description here

So, apparently, the ApplyFilter action cannot retrieve the selected value of the Combobox. What am I doing wrong here?

When I enter a name in the input box, the filter is applied correctly. So the filter works, but I cannot set the filter using the selected combobox value.

It must be something simple, but I cannot find it.

I'm using MS Access Office 365 version.

CodePudding user response:

Remove the [Text] property. You want [Value] and [Value] is the default so doesn't have to be explicitly referenced.

Also need full path reference to combobox.

Forms!yourformName!cboClient

However, really should use ClientID to filter records. If the combobox has ClientID as first column and first column is set as the BoundColumn, then combobox value is ClientID, not ClientName.

  • Related