设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[报表] 请大家帮帮我关于报表打印

[复制链接]
跳转到指定楼层
1#
发表于 2003-1-13 04:40:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我有一个作为数据录入的窗体,还有一个已经制定好的报表.现在的问题是:我想在录入一条记录后,马上通过报表将这条记录打印出来(仅仅是一条记录,不要全部).

我很菜不知道怎么样最好帮我写一下范例我的emal:dxlz@163.net谢谢各位


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2003-1-13 05:06:00 | 只看该作者
这个报表引用查询的数据,查询引用当前窗体的ID就可以啦
3#
 楼主| 发表于 2003-1-13 20:02:00 | 只看该作者

可以详细一点吗?还有别的方法吗?

可以详细一点吗?还有别的方法吗?
4#
发表于 2003-1-13 20:18:00 | 只看该作者
请看northwind.mdb的订单窗体打印发票的例子:
1.printInvoce按钮:
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, "Invoices Filter"  '********here

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

2."Invoices Filter" query:
SELECT DISTINCTROW Invoices.*
FROM Invoices
WHERE (((Invoices.OrderID)=[Forms]![Orders]![OrderID]));

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-11 18:28 , Processed in 0.090334 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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