开发者

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

开发者 https://www.devze.com 2022-12-27 05:15 出处:网络
I have a combo box with a row source based on an SQL query about like SELECT DISTINCT Database_New.ASEC

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?


How about:

 Me.cboASEC.Requery
0

精彩评论

暂无评论...
验证码 换一张
取 消