最近有学员提出 需要对进销存主页优化 如点击采购入库单 打开的窗体只显示对应订单
首先要在模块 里面定义个全局变量 public danju as string
这里需要改下进销存主页的函数
Function DoMenuCmd(MenuText As String, 单据 As String)
Dim MenuID As String
danju = 单据
RunMenuCommand Nz(DLookup("Command", "SysLocalNavigationMenus", "MenuText=" & SQLText(MenuText))), Nothing
MenuID = Nz(DLookup("ID", "SysLocalNavigationMenus", "MenuText=" & SQLText(MenuText)))
With Forms!SysFrmMain
RunDefaultRDPNavMenu MenuID
!lblNodePath.Caption = .mclsNavTree.GetNodeFullPath(MenuID, " > ")
!lblNodePath.Visible = True
If !sfrChild.Top <> !lblNodePath.Top + !lblNodePath.Height Then
!sfrChild.Height = !sfrChild.Height - !lblNodePath.Height
!sfrChild.Top = !lblNodePath.Top + !lblNodePath.Height
End If
End With
End Function
对对应的按钮 的单击事件的代码改成如下 比如采购入库单按钮 =DoMenuCmd("出库入库管理","采购入库单")
之后在库存流水的加载代码适当位置 添加如下代码
If danju <>"" Then Me.sfrList.Form.RecordSource = "Select * FROM 库存流水查询 Where 单据类型='" & danju & "'"