简体   繁体   中英

getting a combo box that has a row source equal to a query - and the query takes data from a form - to update

I have a combo box with a row source based on an SQL query about like

SELECT DISTINCT Database_New.ASEC 
FROM Database_New 
WHERE Database_New.Date>= DateSerial([cboYear], 1, 1)  
      And Database_New.Date<= DateSerial([cboYear], 12, 31); 

the trouble is that if I change the value of cboYear, the values in the drop down cboASEC do not update. I have to open the query, save it and close it to get the thing to update while I have the form open. Is there a way to get the cboASEC to update somehow? maybe a little tidbit of code in the cboYear - afterupdate?

怎么样:

 Me.cboASEC.Requery

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM