子窗体recordsource:SELECT [tbl_PriceListLine].[pll_prlID], [tbl_PriceListLine].[pll_ItemID], [tbl_PriceListLine].[pll_LineNo], [tbl_PriceListLine].[pll_ItemPckg], [tbl_PriceListLine].[pll_Price], [itm_NameL1] & " - " & [itm_NameL2] AS itm_Name FROM tbl_Item INNER JOIN tbl_PriceListLine ON [tbl_Item].[itm_ItemID]=[tbl_PriceListLine].[pll_ItemID] ORDER BY [tbl_PriceListLine].[pll_LineNo];
子窗体中用一个文本框searchbox和一个按钮search来进行筛选,如下:
Private Sub Search_Click()
Dim strSQL As String
DoCmd.ApplyFilter , "itm_Name like '*" & Me.searchbox & "*'"