How Do I Dynamically Filter the ADP Combo Box Rowsource?
Posted on 2006-03-23
Hi, I have a combo box that works great in my MDB using linked tables, and I am trying to migrate it to an ADP. The rowsource property in the MDB is as follows:
SELECT SubPeriods.SubStart, SubPeriods.ID_Subperiod, SubPeriods.ID_Plan FROM SubPeriods WHERE ((SubPeriods.ID_Plan)=Forms!AllocationPlanForm!ID_Plan);
ID_Plan is a control on the form that contains a value that must be used to filter the result set.
In the ADP, I can't get it to work with the WHERE clause. I get the following error message: "Incorrect Syntax Near !". I know that ADP is different but I wonder what is the fastest approach to restricting a combo box based on field value. Is the best approach to build a rowsource string and set the properties on the combo box when the form sends the OnCurrent event?