简体   繁体   中英

Dropdown list in MS Access from a query

I have a valid query in MS Access which pulls data from a linked table. But when I use this query as a row source for a combo box in a form, no data is pulled and the list is empty. What can be the problem?

The Query: SELECT tbl_activityList.ActivityCategory FROM tbl_activityList WHERE (((tbl_activityList.ActivityTeam)=[Forms]![frm_everydayTasks]![lbl_teamName])) GROUP BY tbl_activityList.ActivityCategory;

The Datasheet view, when the query is run:
运行查询时,数据表视图:

The property box:
属性框:

Simple.. I just modified the SQL query. Instead of [Forms]![frm_everydayTasks]![lbl_teamName] I used Me.lbl_teamName.Caption and its working fine. Thanks.

Did you uncheck Hide key column when you created the combo box? Access might be hiding the first column.

组合框

If that's the case, go to Format > Column Widths in the combo box's property sheet and change it to a non-zero number. This should unhide the column.

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