|
9#
楼主 |
发表于 2012-11-6 15:38:10
|
只看该作者
Agent 发表于 2012-11-6 15:14
不好意思,错了一点
谢谢AGENT!
我也刚刚弄好,代码似乎比你的简单些
代码如下,也提供给有需要的朋友:
Private Sub cmd打印_Click()
Dim rptname As String
rptname = "rpt制单费明细"
DoCmd.OpenReport rptname, acViewPreview, , Me.frm制单费明细报表child.Form.Filter
End Sub
Private Sub cmd刷新_Click()
Me.船代.SetFocus
If Me.船代 Like "全部" Then
Me.frm制单费明细报表child.Form.Filter = ""
Me.frm制单费明细报表child.Form.FilterOn = True
ElseIf Me.船代 Like "无" Then
Dim a As String
a = ""
Me.frm制单费明细报表child.Form.Filter = "[船代] = '" & a & "'"
Me.frm制单费明细报表child.Form.FilterOn = True
Else
Me.frm制单费明细报表child.Form.Filter = "[船代] like '*" & Me.船代 & "*'"
Me.frm制单费明细报表child.Form.FilterOn = True
End If
With Me.frm制单费明细报表child
.SetFocus
.Requery
End With
End Sub
|
|