设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1514|回复: 4
打印 上一主题 下一主题

[报表] 如何令一条记录输入完毕后,然后打印的时候可以在报表里打印当前记录?

[复制链接]
跳转到指定楼层
1#
发表于 2002-12-4 18:36:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如何令一条记录输入完毕后,然后打印的时候可以在报表里打印当前记录?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2002-12-4 19:35:00 | 只看该作者
例子见northwind.mdb的发票打印例子。
Sub PrintInvoice_Click()
' This code created by Command Button Wizard.
On Error GoTo Err_PrintInvoice_Click

    Dim strDocName As String
   
    strDocName = "Invoice"
    ' Print Invoice report, using Invoices Filter query to print
    ' invoice for current order.
    DoCmd.OpenReport strDocName, acViewNormal, [B]"Invoices Filter"[/B]'筛选查询

Exit_PrintInvoice_Click:
    Exit Sub

Err_PrintInvoice_Click:
    ' If action was cancelled by the user, don't display an error message.
    Const conErrDoCmdCancelled = 2501
    If (Err = conErrDoCmdCancelled) Then
        Resume Exit_PrintInvoice_Click
    Else
        MsgBox Err.Description
        Resume Exit_PrintInvoice_Click
    End If

End Sub
Invoices Filter筛选查询:
SELECT DISTINCTROW Invoices.*
FROM Invoices
WHERE (((Invoices.OrderID)=[Forms]![Orders]![OrderID]));

3#
 楼主| 发表于 2002-12-5 19:26:00 | 只看该作者
十分感谢
4#
发表于 2002-12-7 09:09:00 | 只看该作者
谢谢!
比我原先的方法高明多了!
5#
发表于 2009-8-12 12:59:33 | 只看该作者
不错
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-22 07:32 , Processed in 0.081902 second(s), 29 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表