本文介绍了我想打印收据,但我遇到了问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这个项目中,我正在使用datareport和dataenvironment来打印收据.

请检查以下代码

In this project I am using datareport and dataenvironment for printing the receipt.

Please check the below code

Private Sub cmdprint_Click()
    'Set rpt = New ADODB.Recordset
    'rpt.Open "select * from reception_detail where ID=" & Val(txtid.Text), Con, adOpenStatic, adLockOptimistic, adCmdText

    DataEnvironment1.Commands(1).CommandText = "select ID,patient_name,patient_age,referedby,test,amount from reception_detail where ID=" & Val(txtid.Text)
    rptreciept.PrintReport
    rptreciept.Show
End Sub




当我单击打印命令时,显示以下错误




When I click on the print command it shows the following the error given below

Run-time error ''5'':<br />
<br />
Invalid procedure call or argument



当我单击debug时,它突出显示了以下行

DataEnvironment1.Commands(1).CommandText =选择ID,患者名,患者年龄,参照,测试,接收金额中的金额,其中ID ="& Val(txtid.Text)



and it highlights the following line when I click on debug

DataEnvironment1.Commands(1).CommandText = "select ID,patient_name,patient_age,referedby,test,amount from reception_detail where ID=" & Val(txtid.Text)

推荐答案



这篇关于我想打印收据,但我遇到了问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 12:41