MS Access Database Check Box List Filters Missing On SQL Server back end

前端 未结 2 1867
遥遥无期
遥遥无期 2021-01-06 00:20

When I connect Access 2007 to SQL Server (whether by ADO recordset or by linked table) I no longer get check box lists (of available filter values) in the datasheet column f

2条回答
  •  孤城傲影
    2021-01-06 00:28

    I know we're breaking protocol by not opening a new question, but I'm going to answer this nevertheless so this thread will be complete. This is a more complete answer than the previous ones.

    I think I have this topic nailed down now.

    The lookup filters won't work with a recordsource that is not an Access object, and they don't work in linked tables directly.

    You have to create a query of the linked table, for example: Select * from tblOrders, and use that query as the recordsource in order to get the lookup filters.

    HOWEVER, I found a more flexible approach as well. I create passthrough queries to SQL/Server and use that as my recordsource. Then, in code, I set the SQL of the passthrough queries like this:

    Currentdb.QueryDefs("qpstOrders").SQL="Select * from Orders where OrderID =" & Me.OrderID
    

    In the current event of my subform, I change the query on the fly to pass the appropriate record -- or it can just be a more generic query. The lookup filters work fine this way and the interaction with SQL/Server is lightning fast.

提交回复
热议问题