在“设计视图”中打开查询时,MS Access会一直崩溃

时间:2016-08-31 11:50:39

标签: sql ms-access crash ms-access-2013 design-view

我有一个不断崩溃整个数据库的查询。它运行正常(和快速),我可以在SQL视图中打开它,但是当我单击设计视图时,我收到的错误消息显示“MS Access已停止工作.Windows正在检查解决方案。”

SQL代码:

SELECT 

    dbo_job.job_date AS Job_Date, 
    dbo_job.item AS FG, 
    dbo_job.job AS Job, 
    dbo_job.suffix AS Suffix, 
    dbo_job.qty_complete AS SL_Production, 
    "" AS SAP_Production, 
    Nz(ibl.sumqty,0) AS SL_Inventory, 
    "" AS SAP_Inventory, 
    dbo_job.Uf_CustPo AS PO, 
    dbo_job.Uf_CustPOLine AS PO_Line

FROM 

    (dbo_job 
    LEFT JOIN 
                (SELECT

                          i2.item
                        , SUM(i2.qty_on_hand) AS sumqty
                        , i2.whse

                    FROM

                        dbo_item_by_location_lp_all AS i2

                    WHERE

                        i2.whse = [Forms]![MainForm]![Combo367]

                    GROUP BY

                          i2.item
                        , i2.whse

                )  AS ibl ON dbo_job.item = ibl.item) INNER JOIN dbo_job_sch ON (dbo_job.suffix = dbo_job_sch.suffix) AND (dbo_job.job = dbo_job_sch.job)

WHERE 

        dbo_job.job Like "H*"
    AND dbo_job.job_date= (Date() - (DatePart("w", Date(), 2, 1)-1))        
    AND dbo_job.item Not Like "indirect"
    AND dbo_job.whse = [Forms]![MainForm]![Combo367]

ORDER BY 

    dbo_job.Uf_Production_Line, 
    dbo_job_sch.priority;

1 个答案:

答案 0 :(得分:0)

There's metadata for each query in Access that records things like how wide the columns are and so on. If that metadata becomes corrupt, you can see the behavior that you see. Copy the SQL text, make a new query in SQL view, and paste the SQL text into the new query. Then try looking at it in design view.